Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create a pivot table in VBA
Hi,
I created a macro (recorded macro)to make a pivot Table. The generated code was the following: (...) Columns("A:H").Select ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _ "relat!C1:C8").CreatePivotTable TableDestination:="", TableName:= _ "TD Vendas" ActiveSheet.Name = "TPVsIva" ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1) ActiveSheet.Cells(3, 1).Select ActiveSheet.PivotTables("TD Vendas").SmallGrid = False ActiveSheet.PivotTables("TD Vendas").AddFields RowFields:=Array( _ "Estrutura", "Dados"), PageFields:="Loja" (...) When I run the macro, the last line genarates an error (Addfields Rowfields line). The error is : "Run Time Error '1004'" with the message "It was not possible to execute the Addfields method of the PivotTables collection" Which is the problem? When I recorded the macro everything was OK. Thanks in advance for your replys, Bruno ... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create a pivot table in VBA
Hi people,
Can annyone help-me with this VBA error? I forgot to said that I'm working with Excel 2000 with NT 4. Thaks in advance Bruno Cost -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to create pivot table from existing pivot table in excel 2007 | Excel Discussion (Misc queries) | |||
can I create pivot table from two other pivot tables? | Excel Discussion (Misc queries) | |||
How do I create multiple pivot charts from one pivot table? | Charts and Charting in Excel | |||
pivot table: create worksheetsheet using pivot table | Excel Discussion (Misc queries) | |||
How do I create a pivot table if the pivot table icon or menu ite. | Charts and Charting in Excel |