Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default VBA range from cell value

I have a macro in which I have the line:
Range (A1:I8).select

The problem is that the row number in Col. I varies.

I would like to get the range from cell L2 in my worksheet and continue the rest of the macro. I can make the proper range in cell L2 I just need to know how to make visual basic look at that cell to determine the range it selects.

Can anyone help me?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default VBA range from cell value

If you're saying you create a text reference to the range (e.g.,
"A1:I100") in cell L2, then use

Range(Range("L2").Text).Select

But I'd guess it would be more efficient to calculate the row number in
VBA directly. Post back explaining how you come up with the method if
you're interested.



In article ,
"Alex" wrote:

I have a macro in which I have the line:
Range (A1:I8).select

The problem is that the row number in Col. I varies.

I would like to get the range from cell L2 in my worksheet and continue the
rest of the macro. I can make the proper range in cell L2 I just need to know
how to make visual basic look at that cell to determine the range it selects.

Can anyone help me?

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
Find Last cell in Range when range is date format default105 Excel Discussion (Misc queries) 5 July 7th 09 03:11 PM
RANGE EXCEL copy cell that meets criteria in a range confused Excel Worksheet Functions 3 March 27th 08 01:41 PM
Referencing a named range based upon Range name entry in cell Barb Reinhardt Excel Worksheet Functions 14 June 20th 07 07:19 PM
Selecting range in list of range names depending on a cell informa Courreges Excel Discussion (Misc queries) 2 June 19th 06 10:59 AM
Range.Find returns cell outside of range when range set to single cell Frank Jones Excel Programming 12 June 10th 04 04:22 AM


All times are GMT +1. The time now is 10:52 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"