Guest User

Untitled

a guest
Jun 20th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. Col(1) = 9
  2. Col(2) = 11
  3. Col(3) = 13
  4. Col(4) = 15
  5. Col(5) = 17
  6. Col(6) = 19
  7. Col(7) = 21
  8. Col(8) = 23
  9. Col(9) = 25
  10. Col(10) = 27
  11. Col(11) = 29
  12.  
  13. Dim myArray() As Variant, myArray2() As Variant
  14. Dim DataRange As Range
  15. Dim cell As Range
  16. Dim x As Long
  17.  
  18. For i = 1 To 11
  19.  
  20. Set DataRange = Worksheets(12).UsedRange.Columns(Col(i))
  21.  
  22. For Each cell In DataRange.Cells
  23. ReDim Preserve myArray(x)
  24. myArray(x) = cell.Value
  25. x = x + 1
  26. Next cell
  27.  
  28. Next i
Add Comment
Please, Sign In to add comment