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: 2
Default How to Set datarange for pivot table?

What is the correct way to update the data source for a pivot table? All I've
come up with is the following, but the new data range does not apply when the
code runs. Is there a way to update the range directly wthout using the
PivotTableWizard method? Is there a way to use "A1" referencing instead of
"R1C1"?

dim X as integer
Sheets("ws1").PivotTableWizard SourceType:=xlDatabase, _
SourceData:="ws2!R1C1:R" & X & "C15"

--
M Carman
 
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
reassignning datarange in a macro Wilkesy Excel Discussion (Misc queries) 2 June 18th 07 05:14 PM
Pivot table datarange as list? Rich at AdventSM Excel Discussion (Misc queries) 0 March 23rd 06 10:37 AM
Setting a datarange Joyce Excel Discussion (Misc queries) 1 May 24th 05 02:22 AM
Datarange of source data Joyce Excel Discussion (Misc queries) 1 May 23rd 05 11:22 PM
Pivot DataRange BackColor Charly[_3_] Excel Programming 2 April 18th 04 02:08 PM


All times are GMT +1. The time now is 04:23 AM.

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"