MichaelRSnow
Active Member
- Joined
- Aug 3, 2010
- Messages
- 391
If have this vb that appplies an auto filter array, is it possible to layer multiple if statements over the top to increase/change the amount of arrays being used in the filter
i.e.
If Range("I12") = "1" Then Array includes ("=*First*", "=*Second*") or
If Range("J12") = "1" Then Array includes ("=*Thrid*", "=*Fourth*") or
If Range("I12") = "1" and Range("J12") = "1"Then Array includes ("=*First*", "=*Second*","=*Thrid*", "=*Fourth*")
So the Array changes depending on the IF statement?
Any help would be much appreciated
Code:
If Workbooks(Range("B4").Value).Sheets("Sheet1").Range("I12") = "1" Then
With Workbooks(Range("B6").Value).Sheets("Sheet2").Rows("1:1")
.AutoFilter Field:=25, Criteria1:=Array("=*First*", "=*Second*"), Operator:=xlFilterValues
End With
Else
End If
i.e.
If Range("I12") = "1" Then Array includes ("=*First*", "=*Second*") or
If Range("J12") = "1" Then Array includes ("=*Thrid*", "=*Fourth*") or
If Range("I12") = "1" and Range("J12") = "1"Then Array includes ("=*First*", "=*Second*","=*Thrid*", "=*Fourth*")
So the Array changes depending on the IF statement?
Any help would be much appreciated