Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Select a range by column number

I need to select a range of cells knowing only the column index number (i)
So Range("C2:C12") needs to be Range("i2:i12").

I know there is the Cells command:
like Cells(5, i).Select
but this only selects one cell. I guess its a syntax problem for me.

Ideally i need to select a range with variable for row and column..any tips
?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Select a range by column number

range(cells(2,i),cells(12,i)).select

However, you usually do NOT need to select to do what is needed and it is
better NOT to select.


--
Don Guillett
SalesAid Software

"David Andrews" wrote in message
news:_8yai.167$%M5.6@trndny02...
I need to select a range of cells knowing only the column index number (i)
So Range("C2:C12") needs to be Range("i2:i12").

I know there is the Cells command:
like Cells(5, i).Select
but this only selects one cell. I guess its a syntax problem for me.

Ideally i need to select a range with variable for row and column..any
tips
?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Select a range by column number

Cells(2, i).Resize(11).Select

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"David Andrews" wrote in message
news:_8yai.167$%M5.6@trndny02...
I need to select a range of cells knowing only the column index number (i)
So Range("C2:C12") needs to be Range("i2:i12").

I know there is the Cells command:
like Cells(5, i).Select
but this only selects one cell. I guess its a syntax problem for me.

Ideally i need to select a range with variable for row and column..any
tips
?




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 number from leftmost column that has one widman Excel Discussion (Misc queries) 4 April 29th 10 02:05 AM
Select range using row and column number addresses NDBC Excel Discussion (Misc queries) 4 July 22nd 09 06:51 AM
Select a column using it's number Keith Excel Programming 1 November 2nd 06 02:56 PM
How do I select the first occurance of a number in a column Corner920 Excel Programming 2 July 18th 05 07:26 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 10:35 AM.

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

About Us

"It's about Microsoft Excel"