Get address of Cell

  • Thread starter Thread starter Terry V
  • Start date Start date
T

Terry V

Hello
I am using:
Dim x as Range
Range("B65536").End(xlUp) to find the last used cell.
Ive tried assigning a variable to this and it returns the value of the cell

x = Range("B65536").End(xlUp) ' returns cell value
I need x to return the cell address without activating the cell.

x = Range("B65536").End(xlUp).Address ' does not work

Any suggestions?
Thank you
Terry
 
Hi Terry,

Sub Tester02()
Dim x As Range
Set x = Range("B65536").End(xlUp)
MsgBox x.Address
End Sub
 
but

Sub Tester03()
Dim x as String
x = Range("B65536").End(xlUp).Address ' does work
msgbox x
End sub

would work as well. Just for the OP's benefit.
 

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

Back
Top