Dim i As Byte, Numb as Byte
i = 8 'row number
Do While i < 122
If Cells(i, 10).Value <> 1 Then
Else
Numb = Cells(i, 9).Value
If Numb = 2 Then
FileNameXls = Array(Cells(i, 6), Cells(i + 1, 6))
Else
If Numb = 3 Then
FileNameXls = Array(Cells(i, 6), Cells(i + 1, 6), Cells(i + 2, 6))
Else
If Numb = 4 Then
FileNameXls = Array(Cells(i, 6), Cells(i + 1, 6), Cells(i + 2, 6), Cells(i + 3, 6))
Else
If Numb = 5 Then
FileNameXls = Array(Cells(i, 6), Cells(i + 1, 6), Cells(i + 2, 6), Cells(i + 3, 6), Cells(i + 4, 6))
If Numb = 6 Then
FileNameXls = Array(Cells(i, 6), Cells(i + 1, 6), Cells(i + 2, 6), Cells(i + 3, 6), Cells(i + 4, 6), Cells(i + 5, 6))
Else
call zipfiles
End If
i = i + 1
Loop
MsgBox "The macro is ready"
End Sub