Excel macro problem on 'value' method
Hi,
Any help with this will be greatly appreciated - I am at a total loss.
Here is the macro code:
Public Function go() As String
Range("B1").Value = "test"
End Function
All very simple - yes?
When this function is called from a cell formula (e.g. set A1 to
'=go()') the result is as follows:
B1 is #VALUE!
A1 is blank (as it was prior to the formula being entered)
Having debugged the macro it is the RANGE line that throws an error.
If I run that same line in the immediate window it works fine.
I am running Excel 2002 in XP and thought it might be something to do
with security etc. But I've played around with that and got nowhere.
I am suspecting something is wrong with the Microsoft playform I have,
and not something general - as it is quite a fundamental cock up in
functionality.
Thanks.
|