Hello all,

Thanks so much for taking the time to help!

I am trying to create a macro that will delete all rows except for the rows that contain the data for the quarters end (march 31, june 30, sept 30, dec 31) for the past 20 years. The dates are in column A.

The problem is that because the stock market is only open until friday, some quarters do not have data for the last couple days of the month.
Example: The last day in September 2012 was Friday the 28th, so the macro needs to recognize that that is still the end of the quarter.

Now I started going through doing this


Sub delete()

n = cells(Rows.Count, "A").End(xlUp).Row
For i = n To 1 Step -1
v = cells(i, 1).Value
If v = "12/31/2000" Or v = "3/30/2001" Then
Else
    cells(i, 1).EntireRow.delete
End If
Next
End Sub

And this works... however I had to manually look up and enter al the dads. I am sure there is a faster way for it to recognize the quarter ends automatically.


Thanks!