ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Detecting "CallingCell" In Function (https://www.excelbanter.com/excel-programming/370757-re-detecting-callingcell-function.html)

Gary''s Student

Detecting "CallingCell" In Function
 
Function who_called_me()
who_called_me = ""
MsgBox (Application.Caller.Address)
End Function

--
Gary's Student


"dec_obrien" wrote:


Hi,
I have a custom function that calculates the Date given various
conditions. What I want to do is conditionally format the cell from
where the function is called based on the day of the week calculated.
It's like "ActiveCell" for the calling cell of the function but
obviously ActiveCell will not be correct. I know I could pass the Cell
Row/ Column in as arguments to teh function but this seems a bit messy
if there an easier way of detecting this.

Any ideas?


--
dec_obrien
------------------------------------------------------------------------
dec_obrien's Profile: http://www.excelforum.com/member.php...o&userid=37705
View this thread: http://www.excelforum.com/showthread...hreadid=572994



dec_obrien

Detecting "CallingCell" In Function
 

Thanks guys, Application.Caller.Address gets teh address of the cell but
it won't change the format of the cell.


--
dec_obrien
------------------------------------------------------------------------
dec_obrien's Profile: http://www.excelforum.com/member.php...o&userid=37705
View this thread: http://www.excelforum.com/showthread...hreadid=572994


NickHK

Detecting "CallingCell" In Function
 
Correct.
Not possible with a worksheet function.

NickHK

"dec_obrien" wrote
in message ...

Thanks guys, Application.Caller.Address gets teh address of the cell but
it won't change the format of the cell.


--
dec_obrien
------------------------------------------------------------------------
dec_obrien's Profile:

http://www.excelforum.com/member.php...o&userid=37705
View this thread: http://www.excelforum.com/showthread...hreadid=572994





All times are GMT +1. The time now is 03:18 PM.

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