
Originally Posted by
cgkmal
I've tried setting to range but when I see the content of "rng" in "Locals" windows it's still only taking the first 3 filtered values.
I've done as below.
Sub Test()
Dim rng As Range
Range("A2:A10").AutoFilter Field:=1, Criteria1:=RGB(255, 0, 0), Operator:=xlFilterCellColor
Set rng = Range("A2:A10").SpecialCells(xlCellTypeVisible)
End Sub
Array can store continuous block of cells.
That means it is equivalent to
Arr = Range("A2:A10").SpecialCells(xlCellTypeVisible).Areas(1).Value
So, if you want all the filtered value in an array, you need to copy the filtered data in somewhere then store in an array.
Bookmarks