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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select range with x value as row 2

Status
Not open for further replies.

chilly442

Technical User
Joined
Jun 25, 2008
Messages
151
Location
US
Want to do something like this, but can't get it to work.

Any ideas???

x = 1
Sheets("Sheet1").Range("x + 1, 15: x + 1, 7").Select

If I run the above code I get:
"application-defined or object-defined error"

Thanks,
Chilly442
 
Remove the quotes from
Code:
"x + 1, 15: x + 1, 7"
 
Have a look at CELLS.

Something like this:
Code:
Sheets("Sheet1").Range(Cells(x + 1, 15), Cells(x + 1, 7)).Select

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top