Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get 2nd parameter of ROW reference to use contents of a specific cell

Status
Not open for further replies.

minnesota

Computer
Aug 8, 2003
1
In VBA how do I enhance this line in a macro to use the contents of cell A1 as the end of the range?

Current:
Rows("2:200").Select

Desired:
Rows("2:A1").Select

I have guessed at various syntax and cannot get it to work.

Thanks very much.
 
Replies continue below

Recommended for you

Can do somthineg like this :

temp = Range("A1").Value
Rows("2:" & temp).Select

Mutt.
 
All you need:
Range([A2], Cells([A1].Value, 1)).EntireRow.Select


Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor