View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ngalula Kachika Michel Ngalula Kachika Michel is offline
external usenet poster
 
Posts: 1
Default Changing PivotTable source

Try this:

Private Sub Worksheet_Activate()
Worksheets("Base").Range("cellule").CurrentRegion. Name
= "cellule"
ActiveSheet.PivotTableWizard SourceType:=xlDatabase,
SourceData:="cellule"
ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh
End Sub


-----Original Message-----
Folks

I'd like to programmatically change the source data of an

existing
PivotTable...

Tried


Code:
--------------------
Activesheet.PivotTables("PivotTable1").SourceData

= "PivotTable_Data"
--------------------


Where "PivotTable1" is an existing pivot table

and "PivotTable_Data" a
valid named range... but this doesn't work...

Any suggestion ?

Regards

--alex



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from

http://www.ExcelForum.com/

.