Thread: UDF Knows Range
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default UDF Knows Range

You can't. A UDF can only return a value to the cell that called it. Have a
look here for a description of UDF's

http://www.cpearson.com/excel/Writin...ionsInVBA.aspx

Mike

"Zone" wrote:

I want my UDF to add a number to the value of the cell to the left of the
cell invoking the UDF. I don't want to specify the location of the cell. I
want the UDF to know what it is. So, if I put
=MyUdf(2) in cell B2, B2 would contain the value of A2 + 2. I thought this
would be Application.Caller, but I can't figure it out! TIA, James