J
Jason Callas
Is it possible to update cells from within a function? I know you can read from them but updating gives the following (really unhelpful) error:
Run-time error '1004': Application-defined or object-defined error
Here is the code for the function:
Public Function Test() As Integer
Range("A2").Value = "Hello"
End Function
The formula from the cell I am calling it from is "=Test()".
NOTE: The error message does not actually pop up when run. You get #VALUE! in the calling cell and the value Hello is not written. What I did for the error was put a break-point on the Range line, then execute the line in the Immediate window.
Run-time error '1004': Application-defined or object-defined error
Here is the code for the function:
Public Function Test() As Integer
Range("A2").Value = "Hello"
End Function
The formula from the cell I am calling it from is "=Test()".
NOTE: The error message does not actually pop up when run. You get #VALUE! in the calling cell and the value Hello is not written. What I did for the error was put a break-point on the Range line, then execute the line in the Immediate window.