I am trying to use the XlPivotFilterType Enumeration in a macro according to this page in the Microsoft MSN website
https://msdn.microsoft.com/en-us/vba...meration-excel
This is the macro I am using
Sub Macro1()
'
' Macro1 Macro
'
Dim PvtTbl As PivotTable
Set PvtTbl = Worksheets("Sheet1").PivotTables("PivoTable1")
'delete all filters currently applied to the PivotTable, using the PivotTable.ClearAllFilters Method
PvtTbl.ClearAllFilters
PvtTbl.PivotFields("Month").PivotFilters.Add Type:=xlAllDatesInPeriodJanuary
'
End Sub
I want to add another month, how to do it? like Feb or Mar or both Feb and Mar, so the end result to be Jan, Feb, Mar ...etc
These are the items for the whole year
xlAllDatesInPeriodJanuary, xlAllDatesInPeriodFebruary, xlAllDatesInPeriodMarch , xlAllDatesInPeriodApril, xlAllDatesInPeriodMay, xlAllDatesInPeriodJune , xlAllDatesInPeriodJuly, xlAllDatesInPeriodAugust, xlAllDatesInPeriodSeptember, xlAllDatesInPeriodOctober, xlAllDatesInPeriodNovember, xlAllDatesInPeriodDecember
Thanks