I have a pivot table that has two filters.
I am using the code below to sort my pivot by these values
this works fine when both the date and month are options.
I want when
- the month "2018-11"- stored in cell F6
- the date "11-04-2018" - stored in cell F3
I am using the code below to sort my pivot by these values
Code:
ActiveSheet.PivotTables("PivotTable2").PivotFields("Month").CurrentPage = Range("g6").Value
ActiveSheet.PivotTables("PivotTable2").PivotFields("Date").CurrentPage = Range("g3").Value
this works fine when both the date and month are options.
I want when
- the date is there but not the month, select ALL for the month
- when the date is missing, do not select anthing....so thee would be no rows in the pivot (this way when I do my lookup of one of the pivot fields (later in the code), it returns NA bc it is not there