function calling cell

Q

Qingde Shi

Hi Masters,

Is there a way to know the calling cell inside the a
function?
eg, there are two (or thousands) cells contain the same
function. within the function, how could get the address
of the cell which the function value return back to?

Many thanks.
 
D

Dave Peterson

One of these:

MsgBox Application.Caller.Address & vbLf & _
Application.Caller.Cells(1).Address & vbLf & _
Application.ThisCell.Address

The last one (ThisCell) was added in xl2002.

The difference between the top two is for multicelled array formulas.
 
Q

Qingde Shi

Thanks, Dave.

One more question, can you change the caller's properties
within the function and how?

Thanks again.

Qingde
 

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