Hello,
I have a pivot table which shows sales data for a group of teams. I wanted a macro to print out a page for each team (the team name is up on the page level). So, using the macro record function, I stepped through the teams, and it generated the following (only showing 2 examples):
Sheets("DAILY TE- CUSTOMER").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("Team").CurrentPage =
"John Jones"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PivotTables("PivotTable1").PivotFields("Team").CurrentPage = _
"Mary Smith"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
When I tried to run it, I got an error message "Syntax error" for line 2 (ActiveSheet.PivotTables... etc.)
Any thoughts as to what might be wrong?
Thanks,
Kevin
I have a pivot table which shows sales data for a group of teams. I wanted a macro to print out a page for each team (the team name is up on the page level). So, using the macro record function, I stepped through the teams, and it generated the following (only showing 2 examples):
Sheets("DAILY TE- CUSTOMER").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("Team").CurrentPage =
"John Jones"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveSheet.PivotTables("PivotTable1").PivotFields("Team").CurrentPage = _
"Mary Smith"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
When I tried to run it, I got an error message "Syntax error" for line 2 (ActiveSheet.PivotTables... etc.)
Any thoughts as to what might be wrong?
Thanks,
Kevin