Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
pivot macro
Hello,
I have an issue trying to play-back a macro that creates a pivot table. Basically, I recorded the creation of a macro in excel 2000 but when I play it a box pops up with this: Run-Tinme error '1004' Unable to get the PivotFields property of the PivotTable class. The pivot table list box that opens up during the playback only shows one of the fields I created. Any ideas? Here's the macro: Sub macro2() Cells.Select ActiveWorkbook.PivotCaches.Add (SourceType:=xlDatabase, SourceData:= _ "'wsprod1_https-443_warning_get_1'! C1:C11").CreatePivotTable TableDestination _ :="", TableName:="PivotTable3", DefaultVersion:=xlPivotTableVersion10 ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1) ActiveSheet.Cells(3, 1).Select ActiveSheet.PivotTables("PivotTable3").PivotFields ("METHOD").Subtotals = Array( _ False, False, False, False, False, False, False, False, False, False, False, False) ActiveSheet.PivotTables("PivotTable3").PivotFields ("Description").Subtotals = _ Array(False, False, False, False, False, False, False, False, False, False, False, False) ActiveSheet.PivotTables("PivotTable3").AddFields RowFields:=Array("METHOD", _ "Description"), PageFields:=Array ("Date", "Time", "Type") ActiveSheet.PivotTables("PivotTable3").PivotFields ("METHOD").Orientation = _ xlDataField ActiveWorkbook.ShowPivotTableFieldList = True Columns("B:B").Select Selection.ColumnWidth = 40 Range("B1").Select End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
pivot macro
Your data source appears to be C1:C11. Not sure how you would get more than
one field from that. -- Regards, Tom Ogilvy Tony wrote in message ... Hello, I have an issue trying to play-back a macro that creates a pivot table. Basically, I recorded the creation of a macro in excel 2000 but when I play it a box pops up with this: Run-Tinme error '1004' Unable to get the PivotFields property of the PivotTable class. The pivot table list box that opens up during the playback only shows one of the fields I created. Any ideas? Here's the macro: Sub macro2() Cells.Select ActiveWorkbook.PivotCaches.Add (SourceType:=xlDatabase, SourceData:= _ "'wsprod1_https-443_warning_get_1'! C1:C11").CreatePivotTable TableDestination _ :="", TableName:="PivotTable3", DefaultVersion:=xlPivotTableVersion10 ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1) ActiveSheet.Cells(3, 1).Select ActiveSheet.PivotTables("PivotTable3").PivotFields ("METHOD").Subtotals = Array( _ False, False, False, False, False, False, False, False, False, False, False, False) ActiveSheet.PivotTables("PivotTable3").PivotFields ("Description").Subtotals = _ Array(False, False, False, False, False, False, False, False, False, False, False, False) ActiveSheet.PivotTables("PivotTable3").AddFields RowFields:=Array("METHOD", _ "Description"), PageFields:=Array ("Date", "Time", "Type") ActiveSheet.PivotTables("PivotTable3").PivotFields ("METHOD").Orientation = _ xlDataField ActiveWorkbook.ShowPivotTableFieldList = True Columns("B:B").Select Selection.ColumnWidth = 40 Range("B1").Select End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
pivot macro
ha!
I saw that selection but somehow didn't relate it to the problem I was having. ...put in the correct range and it works like a champ now. Thanks Tom -----Original Message----- Your data source appears to be C1:C11. Not sure how you would get more than one field from that. -- Regards, Tom Ogilvy Tony wrote in message ... Hello, I have an issue trying to play-back a macro that creates a pivot table. Basically, I recorded the creation of a macro in excel 2000 but when I play it a box pops up with this: Run-Tinme error '1004' Unable to get the PivotFields property of the PivotTable class. The pivot table list box that opens up during the playback only shows one of the fields I created. Any ideas? Here's the macro: Sub macro2() Cells.Select ActiveWorkbook.PivotCaches.Add (SourceType:=xlDatabase, SourceData:= _ "'wsprod1_https-443_warning_get_1'! C1:C11").CreatePivotTable TableDestination _ :="", TableName:="PivotTable3", DefaultVersion:=xlPivotTableVersion10 ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1) ActiveSheet.Cells(3, 1).Select ActiveSheet.PivotTables("PivotTable3").PivotFields ("METHOD").Subtotals = Array( _ False, False, False, False, False, False, False, False, False, False, False, False) ActiveSheet.PivotTables("PivotTable3").PivotFields ("Description").Subtotals = _ Array(False, False, False, False, False, False, False, False, False, False, False, False) ActiveSheet.PivotTables("PivotTable3").AddFields RowFields:=Array("METHOD", _ "Description"), PageFields:=Array ("Date", "Time", "Type") ActiveSheet.PivotTables("PivotTable3").PivotFields ("METHOD").Orientation = _ xlDataField ActiveWorkbook.ShowPivotTableFieldList = True Columns("B:B").Select Selection.ColumnWidth = 40 Range("B1").Select End Sub . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Discussion (Misc queries) | |||
Pivot Table Macro | Excel Discussion (Misc queries) | |||
macro for a pivot | Excel Discussion (Misc queries) | |||
pivot tables macro | Excel Discussion (Misc queries) |