Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have recorded a macro to create a pivottable. The macro includes a
pivottable name which is specific to the table e.g. TableName:="PivotTable1" as below ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _ "Sheet1!R25C10:R30C12").CreatePivotTable TableDestination:= _ "[Book2]Sheet1!R36C10", TableName:="PivotTable1", DefaultVersion:= _ xlPivotTableVersion10 ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:="a" ActiveSheet.PivotTables("PivotTable1").PivotFields ("c").Orientation = _ xlDataField ActiveWorkbook.ShowPivotTableFieldList = False Application.CommandBars("PivotTable").Visible = False Can anybody tell me how to make this macro allocate the next pivottable number to use in the spreadsheet rather than re-use "PivotTable1" each time which seems to cause an error when the table already exists ? Thanks Nigel |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2007 / 2003 Pivottable Macro | Excel Discussion (Misc queries) | |||
Create a Pivottable in a macro | Excel Discussion (Misc queries) | |||
excel2000 pivottable macro | Excel Programming | |||
PivotTable, Scenarios, Macro?? | New Users to Excel | |||
Creating a database and PivotTable with a Macro | Excel Programming |