What is "my" cell?

  • Thread starter Thread starter Josh Sale
  • Start date Start date
J

Josh Sale

Is there a way for a user defined function to tell what cell its being run
from?

For example if cell C3 is set to =MyUDF("x") is there a way for MyUDF to
figure out that its running from C3?

TIA,

josh
 
You can also use

Application.ThisCell

This differs from Application.Caller when used in array formulas.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)
 
Yes. Application.Caller.Address will give the cell containing the function
and
Application.Caller.Parent.Name will give the Worksheet name.
 
Thanks Chip.



Chip Pearson said:
You can also use

Application.ThisCell

This differs from Application.Caller when used in array formulas.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)
 

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