Hi Maneesh ,
Let us start with the first fact about Advanced Filters :
If you make the sheet RawData the active sheet , and then click on Advanced Filter , and select the option Copy to another location , you can only copy to locations on the Active Sheet ; if you select a location on another tab , Excel will display an error message.
So if you wish to have filtered data copied to a different sheet , ensure that you make that sheet the active sheet before the statement to run the Advanced Filter.
The second fact about Advanced Filter is that Excel will only work with criteria cells which are laid out horizontally ; the reason for this is that the raw data is organized as a table with several columns ; Excel always checks the criteria using the first row of the criteria range as the column headers , and the data in the second and following rows of the criteria range as the actual criteria. This naturally means that the first row in the criteria range should have labels which are identical to the column headers of the data table.
For example , if the column in the raw data table is labelled Product , if your criteria range has a column header Products , Excel will give an error message.
In the blog post , the filtered data is on a separate sheet named Filter ; the criteria are user selectable using drop-downs which are pre-defined static drop-downs ; they have not been derived from the raw data using formulae. In your case , you need to do this manually , by going through your data , and listing out the unique values so that they can be used in data validation drop-downs. In the blog post , all the DV drop-down lists are to be found in the tab named Master.
Since the criteria selections have been paid out vertically , in order to be used as a criteria range compatible with the Advanced Filter , the same data has been copied to the RawData tab using formulae.
Other than this , there is just one VBA statement which does the filtering and copying.
If you need any more explanations , please ask.
Narayan