Guest User

Untitled

a guest
Nov 21st, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. Sub displayRandomMatrix(clientsColl As Collection, resultWorkbook As Workbook)
  2.  
  3. Dim NamesRange As Range
  4.  
  5. With resultWorkbook.Worksheets("matrix_random")
  6. ...
  7. Set NamesRange = _
  8. .Range(.Cells(2, 1), .Cells(clientsColl.Count + 1, 1))
  9. Dim NamesArray() As String
  10. ReDim NamesArray(1 To clientsColl.Count)
  11.  
  12. Dim clientRow As Long
  13. Dim simulation As Long
  14. clientRow = 1
  15. simulation = 1
  16.  
  17. Dim clientCopy As client
  18. For Each clientCopy In clientsColl
  19. For simulation = 1 To clientCopy.getRandomNumbers.Count
  20. ...
  21. Next
  22.  
  23. NamesArray(clientRow) = clientCopy.getClientName
  24. clientRow = clientRow + 1
  25. Next
  26. ...
  27. NamesRange.value = NamesArray
  28. ...
  29. End With
  30.  
  31. 'debugging
  32. Debug.Print "**************start"
  33. For clientRow = 1 To clientsColl.Count
  34. Debug.Print NamesArray(clientRow)
  35. Next
  36. Debug.Print "**************end"
  37.  
  38. End Sub
Add Comment
Please, Sign In to add comment