View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Duke Carey Duke Carey is offline
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?