LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default 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?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I know which cell a function is called from? Murami Excel Worksheet Functions 3 November 24th 06 02:22 PM
How do I copy a function with a called cell constant? MitchCarter1957 Excel Worksheet Functions 1 September 6th 05 05:26 PM
How can I find the last time a custom function is called ? James Shoffit Excel Programming 1 December 6th 04 05:52 PM
range.find method called into a VBA function (problem) Eros Pedrini Excel Programming 5 November 17th 04 12:34 PM
How do I find which cell called a function? TL[_2_] Excel Programming 3 July 12th 03 02:12 AM


All times are GMT +1. The time now is 06:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"