I created account class in VBA (ClsAccount), I want to assign Amount property which take an arry of values (for example a revenue ClsAccount can have amount 100 , 200, 300 each one for different year)
Private AccAmount() As Variant
Property Let amount(amt() As Variant)
For Each i In amt
AccAmount(i) = amt(i)
Loop
End Property
Property Get amount() As Variant
amount() = AccAmount()
End Property
Private Sub Class_Initialize()
End Sub
Sub test()
Dim revenue As New ClsAccount
Dim arr(1) As Variant
arr(0) = 100
arr(1) = 200
revenue(0) = arr(0)
revenue(1) = arr(1)
MsgBox revenue(0)
MsgBox revenue(1)
End Sub
I am getting this error: