Hello all,
I am using Excel 2002.
I have a list of data in coloumn A.
I have applied autofilter on that list
and now I am interested in getting the values
that appear when clicking the filter arrow, in vba.
Can anyone help me?
Thanks in advance.
v
To get all of the current Autofilter:
Cells(1, 1).CurrentRegion.SpecialCells(xlCellTypeVisible)
To get just the values in column A:
Range(Cells(2, 1), Cells(2, 1).End(xlDown)).SpecialCells(xlCellTypeVisible)
So, for example
-
Dim c As Range
-
For Each c In Range(Cells(2, 1), Cells(2, 1).End( xlDown )).SpecialCells(xlCellTypeVisible).Cells
-
MsgBox c.Value
-
Next c
HTH --Sam