Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • 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
Joined
Aug 8, 2003
Messages
1
Location
US
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.
 
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

Back
Top