LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Pivot Table Macro with dynamic source data

We've upgraded to Excel 2010. In past macros, I've been able to make
a pivot table dynamic with this script (below) and swapping out the
set range for Range(A1).

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase,
SourceData:= _
Range("A1").CurrentRegion.Address).CreatePivotTabl e
TableDestination:="", TableName:= _
"PivotTable3", DefaultVersion:=xlPivotTableVersion10


Now the script is different with

ActiveWorkbook.PivotCaches.Create(SourceType:=xlDa tabase,
SourceData:= _
"DL!R1C1:R163C16",
Version:=xlPivotTableVersion10).CreatePivotTable _
TableDestination:="Sheet4!R3C1", TableName:="PivotTable2",
DefaultVersion _
:=xlPivotTableVersion10

If I add Range ("A1"), in place of "DL!R1C1:R163C16" I get an error
message. Any ideas?
 
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
use dynamic data source to make pivot table henry Excel Discussion (Misc queries) 0 July 15th 08 02:18 PM
dynamic source range change in pivot table will-d[_2_] Excel Programming 4 January 18th 08 07:53 PM
Dynamic Pivot Table source Conan Kelly Excel Discussion (Misc queries) 3 November 22nd 07 08:25 AM
Change pivot table source data via macro Tim879 Excel Discussion (Misc queries) 2 June 1st 07 01:31 PM
Pivot Table calculated items with dynamic file source [email protected] Excel Programming 0 June 9th 05 05:54 PM


All times are GMT +1. The time now is 06:33 AM.

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

About Us

"It's about Microsoft Excel"