Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table Macro Evil with a K[_2_] Excel Worksheet Functions 1 November 12th 09 07:34 PM
Pivot Table via Macro Roger Converse[_2_] Excel Programming 0 November 19th 07 04:02 PM
Pivot Table by Macro? Roger Converse Charts and Charting in Excel 0 November 7th 07 09:56 PM
Pivot Table Macro PE Excel Programming 1 May 8th 07 10:26 PM
Steps from Macro recorder for Pivot table will not run as a Macro Nancy[_5_] Excel Programming 0 April 2nd 04 10:33 PM


All times are GMT +1. The time now is 02:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"