I have changed the month to a number and the code is as below:
Sub compile_data()
Worksheets(1).Select
For i = 1 To Worksheets.Count - 4
If Worksheets(i).Name <> "30 Day" Or Worksheets(i).Name <> "60 day" Or Worksheets(i).Name <> "90 day" Or Worksheets(i).Name <> "Extra" Then
Worksheets(i).Select
lastrow = Worksheets(i).Range("A1").End(xlDown).Row
For j = 2 To lastrow
Worksheets(i).Rows(j & ":" & j).Copy
If Worksheets(i).Range("E" & j).Value = Month(Date) Then
Worksheets("30 day").Select
ElseIf Worksheets(i).Range("E" & j).Value = Month(Date) + 1 Then
Worksheets("60 day").Select
ElseIf Worksheets(i).Range("E" & j).Value = Month(Date) + 2 Then
Worksheets("90 day").Select
Else
Worksheets("Extra").Select
End If
If Range("A2") = "" Then
lrow = 1
Else
lrow = Range("A1").End(xlDown).Row
End If
Range("A" & lrow + 1).Select
ActiveSheet.Paste
Next
End If
Next
End Sub
I found some entries for September which were not fitting anywhere so i moved them to the "Extra" Tab. If any rows don't meet the criteria, they will go there. That way you can identify if any data is out of place.
Bookmarks