Hello.
With my noobness to VBA... I'm having a bit of a difficult time trying to come up with a way to return the values from one table using a set of criterias that I've filtered for in another table.
Currently I'm using a VBA code that's a workaround but I'm trying to streamline it a bit more. The workaround is shown as below.
Currently I'm calling out the criterias manually that I've filtered for in table2. So the code shows three "ce's". However I'd like to possibly just replace it with something like Range("Table2(Color)") so that it just uses every value under the Color header in table 2.... I tried it but it doesn't work... is there any other variant to possibly doing this??
Sorry for my noobness but I would appreciate any help I can get with this.
I've attached a copy of a sample workbook so that anyone helping doesn't have to re-create the environment.
outrow = 10
For Each ce In Sheets("Sheet1").Range("Table1")
If ce = "Red" Or ce = "Blue" Or ce = "Purple" Then
Cells(outrow, 1).Value = ce
Cells(outrow, 2).Value = ce.Offset(0, 1).Value
Cells(outrow, 3).Value = ce.Offset(0, 2).Value
outrow = outrow + 1
End If
Next ce
Multiple Criterias.xlsm
Thanks in Advance!
Bookmarks