Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default selecting variable rows in a macro that creates a pivot table

You could use a dynamic range as the pivot source, and refer to the
range name in the code. There are instructions he

http://www.contextures.com/xlPivot01.html


amarch00 wrote:
I'm trying to create a multi-consolidation range pivot table via a
macro. Each time I run the macro the number of rows will be different.
The macro is currently hardcoding the source data into a fixed range
for column and row. See below.

How do I change this to allow for a variable row selection?

ActiveWorkbook.PivotCaches.Add(SourceType:=xlConso lidation,
SourceData:= _
Array("'EAG Original'!R1C2:R82C6")).CreatePivotTable
TableDestination:="", _
TableName:="PivotTable15"




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

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
Selecting the current month using a macro on a pivot table Newbee Excel Discussion (Misc queries) 3 November 12th 06 07:10 PM
Selecting a range of values on pivot table attribute with a macro Ryan Hartnett Excel Discussion (Misc queries) 1 October 24th 06 10:21 PM
Pivot table creates blank table [email protected] Charts and Charting in Excel 2 October 17th 06 05:21 PM
Selecting next drop down item in pivot table with a macro ??? Keilan Knight Excel Programming 2 February 22nd 05 11:30 AM
Selecting Rows in Pivot Table MAB71 Excel Programming 2 October 20th 03 06:18 PM


All times are GMT +1. The time now is 10:06 PM.

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"