ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Which cell is calling a user-defined function? (https://www.excelbanter.com/excel-programming/405910-cell-calling-user-defined-function.html)

Randy in Calgary

Which cell is calling a user-defined function?
 
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?

Dave Peterson

Which cell is calling a user-defined function?
 
You can use: Application.caller


Randy in Calgary wrote:

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?


--

Dave Peterson


All times are GMT +1. The time now is 02:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com