View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
CarlsonClan CarlsonClan is offline
external usenet poster
 
Posts: 1
Default Change SourceData in Excel PivotTable via VBA

I am updating a number of files that all require the same pivot table
so I am copying a "standard" pivot table (actually, the whole workshee
the pivot table is in) from one file and pasting it to each file. A
this point, all I want to do is update the SourceData to reflect
named region ("RawData") in each file.

The following gives me an error:

ActiveSheet.PivotTableWizard SourceType:=xlDatabase, _
SourceData:="RawData"
ActiveSheet.PivotTables("RT Data").PivotCache.Refresh

The pivot table is called "RT Data", so that is not the error. Doe
anyone have any suggestions

--
Message posted from http://www.ExcelForum.com