Currently I have data that is already filtered business type. I want to fill an array with the values from another column without any repeats. In other terms I want to fill an array with the filter criteria from another column.
The filter criteria in the other column will change depending on what business type is selected so filling the array needs to be dynamic.
I've researched this online and so far have only found this which doesn't work:
Dim tempArr As Variant
tempArr = Sheets("Sheet1").Filters.Criteria1
Sample Data
buisUnit ProfCenter
SHS 1
SHS 1
SHS 2
SHS 3
SHS 4
ALT 5
ALT 6
ALT 6
ALT 7
So if my data is filtered on buis unit = SHS I would want tempArray = (1,2,3,4) if filtered on ALT i would want (5,6,7)
Thanks in advance.
Worksheets do not have aFiltersproperty. They haveAutoFilter.Filtersbut we need to see your code before we can make suggestions. Another thing, thesat the end ofFiltersindicates a collection, which means you need to use an index to access a certain filter (Filters(1)and so on)