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: 1
Default VBA Pivot Tables with unkown # of rows in the data set

I am trying to create a macro that creates a pivot table. Problem is
the # of rows of data is always variable (# of columns is always
constant).

Does the range of the Pivot table have to be explicitly defined, as
below:
ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:= _
"'Data'!*R1C1:R2500C42*",

Or can the RC:RC reference be variable, and depend on the # of rows?

I have tried concatenating the RC:RC reference, such as:

"'Data'!R1C1:R" & x & "C42",
where x = rowcount(Columns("A:A")) (rowcount is a UDF that counts the #
of rows of data).

But that doesn't work. Any ideas anyone?


---
Message posted from http://www.ExcelForum.com/

 
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
colating multi rows of data into single rows - no to pivot tables! UKMAN Excel Worksheet Functions 4 March 12th 10 04:11 PM
always display rows in Pivot tables (show items with no data) Tausif Excel Discussion (Misc queries) 1 August 4th 09 01:14 PM
Putting data into pivot tables in columns not rows. ACP Excel Discussion (Misc queries) 1 August 24th 05 01:18 PM
Combining Pivot Tables - Summarising data from 100,000 rows Alan Excel Discussion (Misc queries) 1 May 18th 05 10:09 PM
Pivot Tables: How do I show ALL field rows, including empty rows?? [email protected] Excel Worksheet Functions 2 April 8th 05 06:21 PM


All times are GMT +1. The time now is 10:21 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"