Type ABFator
a As Single
b As Sinlge
End Type
Dim ABFactorArr(8) As ABFactor
'Basically I want to declare an array of eight ABFactors which I can then access
I do this and the complier gives error user defined type not defined
Thanks
Type ABFator
a As Single
b As Sinlge
End Type
Dim ABFactorArr(8) As ABFactor
'Basically I want to declare an array of eight ABFactors which I can then access
I do this and the complier gives error user defined type not defined
Thanks
Spelling mistake? Missing c?
ABFator
with no cABFactor
with a cYou've also mistyped Single
in your Type definition
Alternatively perhaps you need to make the Type Public
, in case you are defining it in one module and using it in another?
(Please copy and paste the code into your questions in future, as you've spelt ABFactor three different ways in your question!)
Put this in the code behind of Form1 at the top of the page:
Private Type ABFactor
a As Single
b As Single
End Type
Private Sub Form_Load()
Dim ABFactorArr(8) As ABFactor
Dim i As Byte
For i = 0 To UBound(ABFactorArr)
ABFactorArr(i).a = i
ABFactorArr(i).b = i + 10
Next i
'quick test
Debug.Print ABFactorArr(6).b
End Sub