Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using Macros to create pivot tables - query re last row

I create reports in excel using large amounts of data extracted from a db on
a regular basis. I have created macros to convert this data and then create
pivot tables, again using a macro. I normally have to edit the macro each
time to select the correct amount of data - eg - R1C1:R7131C31 and the next
time there will be more/less rows - columns remain the same regardless. When
creating the macro, can i specify to automatically find the range which
contains only data - i.e. find the last row of data?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,081
Default Using Macros to create pivot tables - query re last row

Use the CurrentRegion property of the R1C1 range. It returns a range object
that consists of all the contiguous cells that contain data


"chubbycheeks" wrote:

I create reports in excel using large amounts of data extracted from a db on
a regular basis. I have created macros to convert this data and then create
pivot tables, again using a macro. I normally have to edit the macro each
time to select the correct amount of data - eg - R1C1:R7131C31 and the next
time there will be more/less rows - columns remain the same regardless. When
creating the macro, can i specify to automatically find the range which
contains only data - i.e. find the last row of data?

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
pasting into pivot tables query paul perkins IOM Excel Discussion (Misc queries) 0 July 29th 09 11:23 AM
Pivot tables and macros Mike Excel Discussion (Misc queries) 1 January 9th 06 04:53 PM
macros and pivot tables... help please! white_rhino[_2_] Excel Programming 1 September 28th 04 03:36 AM
macros and pivot tables... help please! white_rhino Excel Programming 2 September 22nd 04 03:57 AM
Refreshing Pivot Tables QUery Ron McCormick[_2_] Excel Programming 1 December 3rd 03 06:31 PM


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