Address of calling cell?

D

DesertCyclist

Is there a way for a UDF to know the address of the cell that called it? That
cell may not be the active cell!

Thank you.
 
B

Bob Phillips

Application.Caller.Address

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
T

Tim Zych

Application.Caller returns a range object:

Function Func1() As String
Debug.Print Application.Caller.Address
Func1 = "test"
End Function
 
C

Chip Pearson

In a UDF, Application.Caller returns a Range object referencing the cell
from which it was called.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 
D

DesertCyclist

Thank you all. This did the trick!

Bob Phillips said:
Application.Caller.Address

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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