Excel VBA Interpretation (54): The method of sorting --Sort

Excel VBA Interpretation (54): The method of sorting --Sort

Consider the following Excel interface screenshots, "sorting" and "screening" are often together, which is probably a lot of data need to be screened to sort it

 


 

 First, the "Gender" field as sorting, in ascending order, and the first line as header information, as follows:

 

 Next, add the sort fields: the "Gender" field as the first sort in ascending order, a "score" as a second sort fields in descending order. code show as below:

 

 Excel will be "sex" as the primary key in ascending order, a "score" as a secondary key in descending order, i.e., the same primary sort key, then seq keyword ranking


Example 1: Find all of the data satisfies a condition of press order

 

 Example 2: Find Unique data satisfies a condition of

              Worksheet as shown at the beginning of this article, the requirements to obtain the highest score in girls and boys students record data. The advanced filtering and sorting combination can achieve our objective.

 

 

 

 


Reference Links:  http://www.360doc.com/content/17/0507/08/30583536_651749135.shtml

Guess you like

Origin www.cnblogs.com/m0488/p/11982414.html