Sub macro_1()
Dim count
count = 2
Do Until Sheets("BOC").Range("A" & count) = ""
If Strings.Left(Sheets("BOC").Range("D" & count), 2) = "21" Then
Sheets("BOC").Rows(count).Copy Sheets("BOC 21").Rows(Sheets("BOC 21").Range("A" & Rows.count).End(xlUp).Row + 1)
Rows(count).Delete
ElseIf Strings.Left(Sheets("BOC").Range("D" & count), 2) = "22" Or _
Strings.Left(Sheets("BOC").Range("D" & count), 2) = "23" Or _
Strings.Left(Sheets("BOC").Range("D" & count), 2) = "24" Then
Sheets("BOC").Rows(count).Copy Sheets("BOC 22, 23, 24").Rows(Sheets("BBOC 22, 23, 24").Range("A" & Rows.count).End(xlUp).Row + 1)
Rows(count).Delete
ElseIf Strings.Left(Sheets("BOC").Range("D" & count), 2) = "25" Then
Sheets("BOC").Rows(count).Copy Sheets("BOC 25").Rows(Sheets("BOC 25").Range("A" & Rows.count).End(xlUp).Row + 1)
Rows(count).Delete
ElseIf Strings.Left(Sheets("BOC").Range("D" & count), 2) = "26" Then
Sheets("BOC").Rows(count).Copy Sheets("BOC 26").Rows(Sheets("BOC 26").Range("A" & Rows.count).End(xlUp).Row + 1)
Rows(count).Delete
Else
count = count + 1
End If
Loop
End Sub
Bookmarks