I have a custom macro function, declared in a Module :
Function myMacro(value as String) as String
myMacro = "Hello world " & value
End Function
This macro is inserted in a cell (A1 for example) and take the value of B2 as parameter.
Fx(A1 cell) = "MyMacro(B2)"
So my MyMacro func is triggered each time the value in B2 is changed, which is normal and is exactly what I want.
But i want to improve my macro to be more user friendly because my macro can take a long time (3 or 4 seconds) to execute. I want my macro to display "computing..." inside the resulting cell, before the real result is displayed.
To do that, my macro have to know on wich cell the compute is done. In the previous example, my macro need to know that the macro is triggered on the A1 cell.
The Application.Cell attrib contain the current cell (the one selected with the mouse), which is not always the cell containg the macro formula.
Is there a way for a VBA function to know which cell call the function ?