Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find out which cell that called my function
Hi all,
Is there a way to find out which cell that called my function? I would like to set the comment for the calling cell, but I dont now how to find out which cell that called. Public Function anders_test(roof As Variant, tail As Variant) As Variant If IsNumeric(roof) And IsNumeric(tail) Then anders_test = roof / tail Else anders_test = "Invalid input" End If ActiveCell.AddComment Text:="What if I the roof or tail cell was active?" End Function In my example I would set the comment for the cell where result is put, and that works if that cell is active. But if I have a cell calling the function and I change the cell with the roof or tail value the comment comes to the wrong cell. Is this possible to fix? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find out which cell that called my function
Application.Caller
DM Unseen |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find out which cell that called my function
OK, I am hopeful now, but I fail when I try to use the Application.Caller
object to set the comment. I don't understand how the Caller object works and the Help doesn't make me wiser. Thanx in advance Anders "DM Unseen" wrote: Application.Caller DM Unseen |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find out which cell that called my function
Not sure what you mean by set the comment, but as help says, the Caller
property returns information about how it was called. If it is called by a function, caller refers to the range that the function is in. -- HTH Bob Phillips "Anders" wrote in message ... OK, I am hopeful now, but I fail when I try to use the Application.Caller object to set the comment. I don't understand how the Caller object works and the Help doesn't make me wiser. Thanx in advance Anders "DM Unseen" wrote: Application.Caller DM Unseen |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I know which cell a function is called from? | Excel Worksheet Functions | |||
How do I copy a function with a called cell constant? | Excel Worksheet Functions | |||
How can I find the last time a custom function is called ? | Excel Programming | |||
range.find method called into a VBA function (problem) | Excel Programming | |||
How do I find which cell called a function? | Excel Programming |