ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Offset function (https://www.excelbanter.com/excel-programming/274644-re-offset-function.html)

Tom Ogilvy

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





All times are GMT +1. The time now is 03:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com