Get cell address from macro function argument

O

oscar

Is it possible to know the address of the cell that is passed as argument to
a macro function? I want to know this to compare to the cell next to the one
passed to the function.
 
G

Gary''s Student

Yes:

Function qwerty(r As Range) As Integer
MsgBox (r.Offset(0, 1).Address)
qwerty = 0
End Function
 
O

oscar

Thank you for your reply.

Is it possible to use that macro in the formula bar?
I tryed with =qwerty(A1) and I got #NAME?

Thank you for your time
 

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