Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

VBA macro- Range Function

  1. Apr 12, 2008 #1

    How do we select the complete range in the excel file. For example, I hv files with differnt rows and cols and i wanted to write a code to copy the data frm these datasheets to another..so cant use the lines like Range(A1:AJ50).Select..I require somthing generic to change the range depending upon the data in the sheet..please let me know if you know of any such command.

    Also, need a smilar thing for pivot table..need to change sourcedata range R1C1 in the following command dynamically to cover the complete excel sheet..ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _"Sheet1!R1C1:R12C15"

  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted

Similar Threads - macro Range Function Date
C/++/# Finding all Kaprekar numbers in the range [p, q] Feb 6, 2017
If/else C Macro Jul 2, 2015
Generating Colour in Excel Cells Apr 26, 2015
Excel macro's and VBA Jul 27, 2013
Very simple macro script help (pref. AHK) Jul 20, 2011