Thread: VBA range
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
James James is offline
external usenet poster
 
Posts: 542
Default VBA range

I have this line of code and it works but it is dependent on having 100 rows.
I would like to change it up so that it will not be dependednt on having a
certain amount of rows.

Sheets("Raw Data").Range("A7:A100").Copy Destination:=Range("A2")

It is just copying data from the worksheet "Raw Data" to another sheet in
the same workbook. I just never know how many samples I have and would like
to change the code to be a little more flexiable. I thought the change would
of looked like this:

Sheets("Raw Data").Range("A7:A").Copy Destination:=Range("A2")

This didn't work though.

Thanks