View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Offset function

If you are using this in the worksheet such as

=Test2(A1)

then you are correct, a user defined function used in a worksheet can not
change the value of other cells or change the excel environment - it can
only return a value to the cell in which it is located.

--
Regards,
Tom Ogilvy


"Alex" wrote in message
om...
Hi all,
I am looking of a way to get a cell address and then relative to that
cell enter a value in a neighbouring cell
I tried this but it doesn't work. I have looked at other peoples posts
but haven't found anyone that answers this question. Please look at
this simple code and help if you can.

/////////

Function Test2(CellA As Range) As String

CellA.Offset(0, 5).Value = 333
Test2 = "Blabla"

End Function

//////////

Thanks in advance,
Alex