How do I find the address of the last cell in a named range?

J

June Macleod

Is their an easy method for me to find the address of the last cell in a
named range?

Thanks

June
 
D

Dave Peterson

I put named a single area Test99 and another multi-area range test98 and this
worked ok (although, with a multi-area range, the last cell of the last area
might not be what you expected).


Option Explicit
Sub testme()

With Range("test99")
MsgBox .Cells(.Cells.Count).Address
End With

With Range("test98")
With .Areas(.Areas.Count)
MsgBox .Cells(.Cells.Count).Address
End With
End With

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