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
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

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