Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pivot Table via Macro
Hello,
I am trying to record a macro that will create a pivot table based on a spreadsheet. I am receiving error Num: 1004 Unable to get the PivotField property of the PivotTable Class. The code that recorded is below. I am much more familiar with coding in Access, so don't even know where to start here. ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _ "tempPO_ExpSumm!C1:C4").CreatePivotTable TableDestination:="", TableName:= _ "PivotTable4", DefaultVersion:=xlPivotTableVersion10 ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1) ActiveSheet.Cells(3, 1).Select With ActiveSheet.PivotTables("PivotTable4").PivotFields ("Expeditor") .Orientation = xlColumnField .Position = 1 End With With ActiveSheet.PivotTables("PivotTable4").PivotFields ("LS_Date") .Orientation = xlRowField .Position = 1 End With With ActiveSheet.PivotTables("PivotTable4").PivotFields ("PO_Type") .Orientation = xlRowField .Position = 2 End With ActiveSheet.PivotTables("PivotTable4").AddDataFiel d ActiveSheet.PivotTables( _ "PivotTable4").PivotFields("PO_Count"), "Count of PO_Count", xlCount Thank you, Roger |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot Table Macro | Excel Worksheet Functions | |||
Pivot Table via Macro | Excel Programming | |||
Pivot Table by Macro? | Charts and Charting in Excel | |||
Pivot Table Macro | Excel Programming | |||
Steps from Macro recorder for Pivot table will not run as a Macro | Excel Programming |