Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating a pivot table from different sets of data using a macro

Hi,

I'm trying to create a pivot table from an external text
file using a macro. The data always has the same number
of colums (12), but the number of rows varies. This is a
problem - when I record the original macro the data range
for the pivot table is stored in it. When I try to run the
same macro on a data set with a larger number of rows, all
data after the final row indicated by the original data
set is ignored.

Any suggestions greatly appreciated.

Thanks in advance......
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Creating a pivot table from different sets of data using a macro

instead of
worksheets("Sheet1").Range("A1:Z200")

use

Worksheets("Sheet1").Range("A1").CurrentRegion

--
Regards,
Tom Ogilvy

"Éidhne in Ireland" wrote in message
...
Hi,

I'm trying to create a pivot table from an external text
file using a macro. The data always has the same number
of colums (12), but the number of rows varies. This is a
problem - when I record the original macro the data range
for the pivot table is stored in it. When I try to run the
same macro on a data set with a larger number of rows, all
data after the final row indicated by the original data
set is ignored.

Any suggestions greatly appreciated.

Thanks in advance......



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
How can I detail Pivot Table data without creating a table (Excel2007) Skeletiko[_2_] Excel Discussion (Misc queries) 1 May 5th 10 08:22 AM
How can I detail Pivot Table data without creating a table (Excel2007) Skeletiko Excel Discussion (Misc queries) 0 May 5th 10 12:21 AM
Why do I get invalid data source when creating a pivot table? Stricia Excel Discussion (Misc queries) 1 August 9th 07 10:14 PM
Creating a Pivot Table with data in more than one worksheet Rehan Excel Worksheet Functions 1 December 6th 05 12:04 PM
I am having problems creating pivot table of data wyman Charts and Charting in Excel 1 January 12th 05 05:17 PM


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