B
BobAtVandy
This has to be so simple that I'm sure I'll be embarassed, but I'm new to
VBA and haven't been able to figure it out after several hours.
I created a very simple VBA function which simply tries to stuff a value
into a cell on a worksheet.
But I get error 1004 -- "Application-defined or object-defined error"
Function TestCopy()
On Error GoTo ErrHandler
Worksheets("ETF Data").Range("H11").Value = "testdata"
TestCopy = 1
Exit Function
ErrHandler:
MsgBox Err.Number & " : " & Err.Description
TestCopy = 0
End Function
I can assure you that the named worksheet, "ETF Data" exists. And, when I
fetch values from the sheet [[ e.g.,
x = Worksheets("ETF Data").Range("H11").Value ]] it works.
Can someone PLEASE tell me what is going on?
Thanks.
VBA and haven't been able to figure it out after several hours.
I created a very simple VBA function which simply tries to stuff a value
into a cell on a worksheet.
But I get error 1004 -- "Application-defined or object-defined error"
Function TestCopy()
On Error GoTo ErrHandler
Worksheets("ETF Data").Range("H11").Value = "testdata"
TestCopy = 1
Exit Function
ErrHandler:
MsgBox Err.Number & " : " & Err.Description
TestCopy = 0
End Function
I can assure you that the named worksheet, "ETF Data" exists. And, when I
fetch values from the sheet [[ e.g.,
x = Worksheets("ETF Data").Range("H11").Value ]] it works.
Can someone PLEASE tell me what is going on?
Thanks.