jmutsche
12-13-2013, 01:58 PM
Columns("A:H").Select
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Summary Collected Pivot!R1C1:R1048576C8", Version:=xlPivotTableVersion12).CreatePivotTable _
TableDestination:="Summary Collected Pivot!R3C1", TableName:="PivotTable4", DefaultVersion _
:=xlPivotTableVersion12
'
Sheets("Summary Collected Pivot").Select
Cells(3, 1).Select
With ActiveSheet.PivotTables("PivotTable7").PivotFields("Row Labels")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable7").AddDataField ActiveSheet.PivotTables( _
"PivotTable7").PivotFields("201308"), "Count of 201308", xlSum
ActiveSheet.PivotTables("PivotTable7").AddDataField ActiveSheet.PivotTables( _
"PivotTable7").PivotFields("201309"), "Count of 201309", xlSum
ActiveSheet.PivotTables("PivotTable7").AddDataField ActiveSheet.PivotTables( _
"PivotTable7").PivotFields("201310"), "Count of 201310", xlSum
ActiveSheet.PivotTables("PivotTable7").AddDataField ActiveSheet.PivotTables( _
"PivotTable7").PivotFields("201311"), "Count of 201311", xlSum
Having trouble making a pivot table its spitting out error 5 invalid procedure or argument. the weird thing is I recorded this macro, and I use to make pivot tables all the time like this and now its not working? any ideas
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"Summary Collected Pivot!R1C1:R1048576C8", Version:=xlPivotTableVersion12).CreatePivotTable _
TableDestination:="Summary Collected Pivot!R3C1", TableName:="PivotTable4", DefaultVersion _
:=xlPivotTableVersion12
'
Sheets("Summary Collected Pivot").Select
Cells(3, 1).Select
With ActiveSheet.PivotTables("PivotTable7").PivotFields("Row Labels")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable7").AddDataField ActiveSheet.PivotTables( _
"PivotTable7").PivotFields("201308"), "Count of 201308", xlSum
ActiveSheet.PivotTables("PivotTable7").AddDataField ActiveSheet.PivotTables( _
"PivotTable7").PivotFields("201309"), "Count of 201309", xlSum
ActiveSheet.PivotTables("PivotTable7").AddDataField ActiveSheet.PivotTables( _
"PivotTable7").PivotFields("201310"), "Count of 201310", xlSum
ActiveSheet.PivotTables("PivotTable7").AddDataField ActiveSheet.PivotTables( _
"PivotTable7").PivotFields("201311"), "Count of 201311", xlSum
Having trouble making a pivot table its spitting out error 5 invalid procedure or argument. the weird thing is I recorded this macro, and I use to make pivot tables all the time like this and now its not working? any ideas