firstly thank you for your help
I wrote a code that go through a specific columns then start to get all the values <=1 in that column and assign it to a specific array. I want to automate this process. Please take a look to the code
Sub zones()
Dim Top10zones(0 To 9) As Long
Dim found As Boolean
Dim temp As Variant
Dim Arry0 As Variant
Dim Arry1 As Variant
Dim Arry2 As Variant
Dim Arry3 As Variant
Dim Arry4 As Variant
Dim Arry5 As Variant
Dim Arry6 As Variant
Dim Arry7 As Variant
Dim Arry8 As Variant
Dim Arry9 As Variant
Top10zones(0) = 309101502
Top10zones(1) = 309101802
Top10zones(2) = 106900101
Top10zones(3) = 9082004
Top10zones(4) = 407100901
Top10zones(5) = 2056355
Top10zones(6) = 5075001
Top10zones(7) = 10092021
Top10zones(8) = 5075005
Top10zones(9) = 205701516
NumRows = Range("A1", Range("A1").End(xlDown)).Rows.Count
For i = 0 To 9
Range("A1").Select
Do Until IsEmpty(ActiveCell)
If ActiveCell.Value = Top10zones(i) Then
found = True
Exit Do
End If
ActiveCell.Offset(0, 1).Select
Loop
' Check for found.
If found = True Then
ActiveCell.Offset(1, 0).Select
For j = 2 To NumRows
If ActiveCell.Value <= 1 Then
temp = temp & "," & Cells(j, 1)
End If
ActiveCell.Offset(1, 0).Select
Next j
Arryi = Split(Mid(temp, 2), ",")
End If
End Sub
The problem that I have at the end, how can assign to different arrays in a for loop