I would like to place a range (table2) in an array within a macro instead of multiple variables. Here is the macro so far:
I would like something similar to this instead:
(Of course above doesn't work for some reason
)
To help you better understand the variables "Pink" and "White" are included in table2. Here is table2:
Column1
Pink
White
Possible? I hope!
Thanks![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Nicole
Rich (BB code):
Sub Test()
Dim LR As Long, i As Long
CountryColumn = xl_Col(Range("Table1[Column2]").Column)
LR = Range(CountryColumn & Rows.Count).End(xlUp).Row
For i = LR To 2 Step -1
Rows(i).Hidden = IsError(Application.Match(LCase(Range(CountryColumn _
& i).Value), Array("Pink", "White"), 0))
Next i
End Sub
Rich (BB code):
Sub Test()
Dim LR As Long, i As Long
CountryColumn = xl_Col(Range("Table1[Column2]").Column)
LR = Range(CountryColumn & Rows.Count).End(xlUp).Row
For i = LR To 2 Step -1
Rows(i).Hidden = IsError(Application.Match(LCase(Range(CountryColumn _
& i).Value), Array(Range("Table2")), 0))
Next i
End Sub
To help you better understand the variables "Pink" and "White" are included in table2. Here is table2:
Column1
Pink
White
Possible? I hope!
Thanks
Nicole
Last edited: