View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
NDBC NDBC is offline
external usenet poster
 
Posts: 204
Default Select range using row and column number addresses

Thanks for explaining the differences to me. Makes it a lot easier to
understand so I don't have to muddle my way through.

"Jacob Skaria" wrote:

In your case the below should work

Range("A1" , Cells(ARow, MaxA)).Copy

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Good... It is a bit more easier...

--When you work with column numbers and row numbers try
Range(Cells(r1,c1), Cells(r2,c2))
where r1,c1,r2,c2 are numbers

--When you work with row numbers try Range("A1","J10") OR Range("A1:J10")
Range("A" & r1 & ":J" & r2)
Range("A" & r1 , "J" & r2)
where r1 and r2 are row numbers and A and J are column names or you can
replace those with string variables.

OR

Range(Cells(r1,"A"),Cells(r2,"J")) where r1 and r2 are row numbers and A and
J are column names or you can replace those with string variables.

If this post helps click Yes
---------------
Jacob Skaria


"NDBC" wrote:

I've done it now.

For those interested

wb.Sheets("A Lap").Range("a1:" & Cells(ARow, MaxA).Address).Copy
wbNew.Sheets("Sheet1").Range("A1")


"NDBC" wrote:

I'm trying to select a range starting in a1 and finishing at a known row and
column number. I have tried this but am getting an error. Arow is the number
of rows down and MAxa is the number of columns across.

wb.Sheets("A Lap").Range("a1:" & Cells(ARow, MaxA)).Copy
wbNew.Sheets("Sheet1").Range("A1")

I'm guessing either cells is the wrong command or i'm using it incorrectly.
Thanks