I try to make cell A1, A2, A3 = aa
using code below but getting error “Object required”.
Public Function cellv(ByVal row As Variant, col As Integer) As Variant
cellv = ThisWorkbook.Sheets("Tree").Cells(row, col).Value
End Function
'---------------------- '
Public Sub testz()
Dim j
For j = 1 To 3
cellv(j, 1) = "aa"
Next j
End Sub
If I use Debug.Print cellv(j,1)
, it work without error.