Babycat
Member
- Local time
- Today, 14:17
- Joined
- Mar 31, 2020
- Messages
- 281
Dear all.
I have structure (type) in VBA and an array
And I expect to init ItemArray like:
but It does not work, so I have to assign one by one:
Is there any way to declare and init array value shortly as i expected?
I have structure (type) in VBA and an array
Code:
Private Type Item_property
Itemname As String
ItemMaterial As String
End Type
Dim ItemArray() As Item_property
Code:
ItemArray = { ("Knife", "Steel"); ("Ruler", "Plastic"); ("Ring", "Gold")}
Code:
ItemArray(0).Itemname = "Knife"
ItemArray(0).ItemMaterial = "Steel"
..so on...
Is there any way to declare and init array value shortly as i expected?