Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Select range using row and column number addresses
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Select range using row and column number addresses
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 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Select range using row and column number addresses
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 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Select range using row and column number addresses
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 |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Select Range based on column name and not A1 notations | Excel Discussion (Misc queries) | |||
Select a Range of column depending on the date | Excel Worksheet Functions | |||
select date range in column | Excel Worksheet Functions | |||
hOW DO i CHANGE COLUMN WIDTH FOR ONLY A SELECT RANGE OF CELLS? | Excel Discussion (Misc queries) | |||
Select same range from large number of workbooks | Excel Worksheet Functions |