I have a macro that creates a pivot table called "PivotTable1" from my data source "Sheet1." I then recorded a macro that copied and pasted "PivotTable1" into two new sheets, so in the two new sheets the first pivot table is called "PivotTable1" and "PivotTable2" respectively. I renamed the two new sheets "Quote Count" and "Line Count" respectively.
The problem I am having is that when I run the macro more than once, the two copied pivot tables change name from "PivotTable1" and "PivotTable2" to "PivotTable3" and "PivotTable4" and then if I run the macro again it will change to "PivotTable5" and "PivotTable6" and so on.
I want to ensure that when the two copied pivot tables are created the sheet name is the same as the Pivot Table name, so then when I re run the macro I wont get errors because the Pivot Table name has changed. If anyone knows code on how to make the sheet names the same as the new copied pivot table names that would be great.
Thanks,
J
Bookmarks