Dinesh Santhalingam

Dinesh Santhalingam

  • NA
  • 737
  • 368.7k

How to create multiple arrays dynamically in VBA

May 12 2017 3:42 AM
I need to create Multiple arrays to store my values .Can anyone please give me the solution?
 
 
  1. For i = 1 To 6  
  2. Dim oFirst_family As MaterialFamily  
  3. Dim ifno As Integer  
  4. ifno = i  
  5. Set oFirst_family = cFamilies_list.Item(ifamily_no)  
  6. Dim sFamilyName As String  
  7. sFamilyName = oFirst_family.Name  
  8. MsgBox sFamilyName  
  9. Set cMaterials_list = oFirst_family.Materials  
  10. iNb_materials = cMaterials_list.Count  
  11. //Here i want to create multiple arrays for every iteration .  
  12. For j = 1 To iNb_materials  
  13. imaterial_no = j  
  14. Set oMaterial1 = cMaterials_list.Item(imaterial_no)  
  15. ReDim Preserve test(j)  
  16. test(j) = oMaterial1.Name  
  17.  
  18. Next  

  19. Next  
 

Answers (6)