Selection XL Down 3 consecutive times

L

LuisE

Is there any way to do the following in one line of code?
I need to use that row as a variable. It is not the last cell in that column.
Thanks in advance

Range("B1").Select
Selection.End(xlDown).Select
Selection.End(xlDown).Select
Selection.End(xlDown).Select
Selection.Row
 
G

Gary''s Student

How about:

Sub ordinat()
Range("B1").Select
Selection.End(xlDown).End(xlDown).End(xlDown).Select
n = Selection.Row
End Sub

only two Selects rather than four.
 
G

Gary''s Student

Better still:

Sub better()
Range("B1").End(xlDown).End(xlDown).End(xlDown).Select
n = Selection.Row
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top