Hi Guys
The Code given below was give to me by a friend, which helps me to update the pivot tables that I have on a sheet, and also helps me to select the month for which i am checking the report. Now what i have done is i put the data on sheet 2 and sheet 3 and all the pivot tables are on sheet 1. after i have done this change i start getting error from
" ActiveSheet.PivotTables("PivotTable2").PivotFields("Month").CurrentPage = Range("Month") * 1" the line mentioned above. I think it has something to do with either selecting the month or may due to the movement of the pivot to sheet 1. Can somebody help me on this pleaseeeeeeee
![]()
Option Explicit Sub Update() ActiveSheet.PivotTables("PivotTable2").RefreshTable ActiveSheet.PivotTables("PivotTable4").RefreshTable ActiveSheet.PivotTables("PivotTable5").RefreshTable ActiveSheet.PivotTables("PivotTable6").RefreshTable ActiveSheet.PivotTables("PivotTable2").PivotFields("Month").CurrentPage = Range("Month") * 1 ActiveSheet.PivotTables("PivotTable4").PivotFields("Month").CurrentPage = Range("Month") * 1 ActiveSheet.PivotTables("PivotTable5").PivotFields("Month").CurrentPage = Range("Month") * 1 ActiveSheet.PivotTables("PivotTable6").PivotFields("Month").CurrentPage = Range("Month") * 1 End Sub
Bookmarks