I need to create Multiple arrays to store my values .Can anyone please give me the solution?
- For i = 1 To 6
- Dim oFirst_family As MaterialFamily
- Dim ifno As Integer
- ifno = i
- Set oFirst_family = cFamilies_list.Item(ifamily_no)
- Dim sFamilyName As String
- sFamilyName = oFirst_family.Name
- MsgBox sFamilyName
- Set cMaterials_list = oFirst_family.Materials
- iNb_materials = cMaterials_list.Count
- //Here i want to create multiple arrays for every iteration .
- For j = 1 To iNb_materials
- imaterial_no = j
- Set oMaterial1 = cMaterials_list.Item(imaterial_no)
- ReDim Preserve test(j)
- test(j) = oMaterial1.Name
- Next
- Next

Madhanmohan DevarajanRank #342 · 7.3K reputationPosted May 12, 2017, 5:43 AM EDT
Hi Dinesh,
Hope you are trying to implement dynamic arrays in your macro. But would like to know where you have declared the array test in your code.
like shown below: Dim test() as string
Are you looking for multi-dimensional array or just dynamic array?
If it is just dynamic array then you have already having it in your code.
If you are looking for multi-dimensional array it is here
Dinesh SanthalingamRank #2,085 · 690 reputationPosted May 12, 2017, 6:18 AM EDT
Madhanmohan DevarajanRank #342 · 7.3K reputationPosted May 12, 2017, 6:29 AM EDT
Dinesh SanthalingamRank #2,085 · 690 reputationPosted May 12, 2017, 6:32 AM EDT
Madhanmohan DevarajanRank #342 · 7.3K reputationPosted May 12, 2017, 6:42 AM EDT
Madhanmohan DevarajanRank #342 · 7.3K reputationPosted May 12, 2017, 6:56 AM EDT