ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Address of Formula (https://www.excelbanter.com/excel-programming/434257-address-formula.html)

Tommy

Address of Formula
 
How can I get the cell address of the formula that calls a custom function?

Public Function Test(ByVal r As Range) As Integer
'How can I determine what cell contained the formula that called the
function
End Function

For instance, if the SQRT(range) is called and the formula is on the same
row as one of the values in the range, it will compute the SQRT of the number
stored on on the same row. I want to be able to do the same type thing.



Dave Peterson

Address of Formula
 
Public Function Test(ByVal r As Range) As Integer
msgbox application.caller
'How can I determine what cell contained the formula that called the
function


Tommy wrote:

How can I get the cell address of the formula that calls a custom function?

Public Function Test(ByVal r As Range) As Integer
'How can I determine what cell contained the formula that called the
function
End Function

For instance, if the SQRT(range) is called and the formula is on the same
row as one of the values in the range, it will compute the SQRT of the number
stored on on the same row. I want to be able to do the same type thing.


--

Dave Peterson


All times are GMT +1. The time now is 09:53 AM.

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