View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Never tried this location in excel

Curt,
If you mean with a worksheet function, then No. This can only return a
value. e.g.

Public Function InvalidWorksheetFunction(argValue As Variant) As Long
Debug.Print Application.Caller.Offset(0, -1).Address
Application.Caller.Offset(0, -1).Value = argValue
InValidWorksheetFunction = 1
End Function

However, called from VBA, this is valid
Public Function ValidFunction(argBase As Range, NewValue As Variant,
Optional ColOffset As Long = -1) As Boolean
argBase.Offset(0, ColOffset).Value = NewValue
ValidFunction = True
End Function
although you should add checking of a valid Offset, so you are not off the
sheet.

NickHK

"Curt" wrote in message
...
Is it possible to call a procedure and have excel put in cell address of
calling location. Have a procedure that must be called from many

locations
and return data to location in precedding column.
Never tried this.