Which cell is calling a user-defined function?

R

Randy in Calgary

I am writing a VBA function that may appear in multiple worksheet cells, and
may be entered as a array formula, {=MyFunc(input_range)}. How do I get the
address of the cell from which the function was called when the worksheet is
being recalculated?
 
D

Dave Peterson

You can use: Application.caller

I am writing a VBA function that may appear in multiple worksheet cells, and
may be entered as a array formula, {=MyFunc(input_range)}. How do I get the
address of the cell from which the function was called when the worksheet is
being recalculated?
 

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