Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Changing PivotTable source

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/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Changing PivotTable source

Why not set the source to a named range originally, then redefine the
definition of the named range.

--
Regards,
Tom Ogilvy


atakacs wrote in 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/



  #3   Report Post  
Posted to microsoft.public.excel.programming
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/

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Changing PivotTable source

I don't use PPT, but you may find some sample code here at Jon Peltier's site:

http://www.geocities.com/jonpeltier/Excel/XL_PPT.html


Ngalula Kachika Michel wrote:

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/

.


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
what types of source data can't be grouped in pivottable Group items in a PivotTable Excel Discussion (Misc queries) 0 September 2nd 09 10:31 AM
Dynamic PivotTable Data Source Lenardz Excel Discussion (Misc queries) 1 August 22nd 07 08:08 PM
I NEED TO KNOW THE SOURCE OF A PIVOTTABLE FROM ACCESS FORMULA Excel Discussion (Misc queries) 0 July 20th 06 05:27 PM
Pivottable - dynamically changing the range of cells Todd1 Excel Discussion (Misc queries) 1 March 28th 06 06:22 PM
Select different source data for a PivotTable chetoos Excel Worksheet Functions 1 September 8th 05 07:14 PM


All times are GMT +1. The time now is 01:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"