Hello,
So I have set 3 dates like this in excel:
Dim TradeDate As Range
Set TradeDate = ActiveSheet.Range("AA1")
Dim TradeDate1 As Range
Set TradeDate1 = ActiveSheet.Range("AB1")
Dim TradeDate2 As Range
Set TradeDate2 = ActiveSheet.Range("AC1")
Then I have a pivot table with thew date on column 4 and I am trying to filter OFF those date
With one date it is easy as I can just put:
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=4, Criteria1:="<>"TradeDate
but it does not work with multiple criteria so I tried something like this and still not working
Selection.AutoFilter Field:=4, Criteria1:"<>" Array( _
TradeDate, TradeDate1, TradeDate2), Operator:=xlFilterValues
Any idea on what is wrong with the code?
Thank you
So I have set 3 dates like this in excel:
Dim TradeDate As Range
Set TradeDate = ActiveSheet.Range("AA1")
Dim TradeDate1 As Range
Set TradeDate1 = ActiveSheet.Range("AB1")
Dim TradeDate2 As Range
Set TradeDate2 = ActiveSheet.Range("AC1")
Then I have a pivot table with thew date on column 4 and I am trying to filter OFF those date
With one date it is easy as I can just put:
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=4, Criteria1:="<>"TradeDate
but it does not work with multiple criteria so I tried something like this and still not working
Selection.AutoFilter Field:=4, Criteria1:"<>" Array( _
TradeDate, TradeDate1, TradeDate2), Operator:=xlFilterValues
Any idea on what is wrong with the code?
Thank you