Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing Pivot Table Source Data
I'm trying to change the source data for a pivot table and am using this syntax
myPivot.SourceData = myString where mystring = 'ALL ITEMS'!all_items I'm getting a run time error 1004, reference is not valid. I'm not sure what the problem might be. Can someone assist? Thanks, Barb Reinhardt |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing Pivot Table Source Data
this works for me...
Sub set_two() Dim pc As PivotCache Dim pt As PivotTable Set pt = Sheet1.PivotTables(1) With pt .SourceData = "'ALL ITEMS'!all_items" .RefreshTable End With End Sub i was able to raise error 1004 by using a range name that didn't exist - ie mis-typing the name Patrick Moloy "Barb Reinhardt" wrote: I'm trying to change the source data for a pivot table and am using this syntax myPivot.SourceData = myString where mystring = 'ALL ITEMS'!all_items I'm getting a run time error 1004, reference is not valid. I'm not sure what the problem might be. Can someone assist? Thanks, Barb Reinhardt |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Changing Pivot Table Data Source to multiple ranges | Charts and Charting in Excel | |||
How to refresh a pivot table that uses changing source data | Excel Programming | |||
Changing Pivot Table source | Excel Discussion (Misc queries) | |||
Changing Data Source for Pivot Table | Excel Discussion (Misc queries) | |||
Changing data source in pivot table- "Back" button is disable | Excel Discussion (Misc queries) |