Extracting a Unique List of Values with VBA Code

In VBA, you use the .AdvancedFilter method to carry out the Advanced Filter command. Again, there are three choices to make.

■ Action: Choose to either filter in place with the parameter Action:=xlFilterInPlace or to copy with Action:=xlFilterCopy. If you want to copy, you also have to specify the parameter CopyToRange:=Range("J1").

Figure 11.4

The Advanced Filter extracted a unique list of customers from the dataset and copied it to Column J. Extracting a unique list of values from a dataset has many uses. For example,you may now offer to produce a report for any or all of those customers.

Hm|ton PiaJiia Pat* Cimteinn

0 0

Post a comment