View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_3_] Alan Beban[_3_] is offline
external usenet poster
 
Posts: 130
Default How do I find which cell called a function?

If Type Of Application.Caller Is Range Then
Msgbox Application.Caller.Address
End if

Alan Beban

TL wrote:
I have a user function called from a cell on the
spreadsheet which draws a line based on input from
ajoining cells.

The cell content looks like this:

=LinkDraw(x1,y1,x2,y2)

The value of the cell is just 0 for fail and 1 for success.

Works great, but now I need to be able to determine, from
within the LinkDraw() function, which cell called the
function.

Ideally, I would like to do this without any kludgy
nonsense like feeding the answer as an input variable:

=LinkDraw(x1,y1,x2,y2,CELL(row),CELL(col)) <-Yucky.

Any suggestions?
-TL