View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
DNewton[_4_] DNewton[_4_] is offline
external usenet poster
 
Posts: 1
Default Pivot Table Name Reset

Hello,
I'm using a macro to import a text file, create two new sheets within
that file with three pivot tables on each new sheet and save the file
as an Excel spreadsheet. This basic macro is run for each of several
text files.

I used the macro record feature to create the pivot tables and these
are the names Excel assigned to the tables:

Sheet 1: PivotTable1, PivotTable2, PivotTable3
Sheet 2: PivotTable1, PivotTable4, PivotTable5

When I import the next text file, the names assigned a

Sheet 1: PivotTable1, PivotTable6, PivotTable7
Sheet 2: PivotTable1, PivotTable8, PivotTable9

Is there any way to reset Excel's internal counter so that each time I
run the macro the table names will be the same instead of incrementing
by one each time?

If I go back and try to import the first text file again and the macro
refers to the original names for formatting the table, I get an error
because the pivot table has been assigned a different number this time.


Thanks!


---
Message posted from http://www.ExcelForum.com/