A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Hi
You must refer the sheet name where pivot table 5 is.
Set pf = ThisWorkbook.Sheets("The name of your sheet").PivotTables("PivotTable5").PivotFields("Month")
Hope this helps you