I am trying to write a macro that will advance to the next unique criteria in an autofilter list.
I have roughly 2500 rows of data, but only need to filter by one criteria: The company name.
Using the Macro recorder to switch from Company A to Company B, I get this:
In the spread sheet I could have over 250 company names, but I sometimes have the need to go through them one by one to pull all data for each company. I currently just use the auto filter, but it takes some considerable time to pull down the list, deselect and then re-select the next name.
Is there a way to tell the criteria to just look for the next unique value in the list?
I have roughly 2500 rows of data, but only need to filter by one criteria: The company name.
Using the Macro recorder to switch from Company A to Company B, I get this:
Code:
ActiveSheet.Range("$A$4:$A$2500").AutoFilter Field:=1, Criteria1:= _"Company Name B"
In the spread sheet I could have over 250 company names, but I sometimes have the need to go through them one by one to pull all data for each company. I currently just use the auto filter, but it takes some considerable time to pull down the list, deselect and then re-select the next name.
Is there a way to tell the criteria to just look for the next unique value in the list?
Last edited: