Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 204
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 204
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default 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   Report Post  
Posted to microsoft.public.excel.misc
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select Range based on column name and not A1 notations T.Vidak Excel Discussion (Misc queries) 3 July 16th 08 02:02 PM
Select a Range of column depending on the date Battykoda via OfficeKB.com Excel Worksheet Functions 1 May 2nd 07 08:22 PM
select date range in column garlocd Excel Worksheet Functions 2 July 11th 06 06:23 AM
hOW DO i CHANGE COLUMN WIDTH FOR ONLY A SELECT RANGE OF CELLS? RCONLON_291 Excel Discussion (Misc queries) 2 September 16th 05 11:24 AM
Select same range from large number of workbooks BillC Excel Worksheet Functions 2 February 18th 05 08:59 PM


All times are GMT +1. The time now is 07:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"