G
Guest
I have a vba function as follows:
Function zputData()
Dim cell As Range
Set Range1 = ActiveSheet.Range("a1:a7")
For Each cell In Range1.Cells
cell.Value = "abc"
Next
End Function
If i put =zputData() in A10 I get a #VALUE! and do not get abc in cells a1 to a7.
If i execute abc= zputData() in the immediate window, a1 to a7 gets set.
What am I doing wrong?
Thanks,
Fred
Function zputData()
Dim cell As Range
Set Range1 = ActiveSheet.Range("a1:a7")
For Each cell In Range1.Cells
cell.Value = "abc"
Next
End Function
If i put =zputData() in A10 I get a #VALUE! and do not get abc in cells a1 to a7.
If i execute abc= zputData() in the immediate window, a1 to a7 gets set.
What am I doing wrong?
Thanks,
Fred