G
Guest
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?
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?