I am trying to run an equation in my spread sheet that will go through column “I” and delete every row that does not have an expiration date within 90 days from now… In other words i am trying to format my spread sheet to just give me a list of everything that is expiring in the next 90 days. The row where I put the stars is where I am having difficulty inserting the equation. I am not sure how to insert the equation but if it was ran in cell by itself it would look like this =IF(AND(I11-900),1,0)=1. What would I change Q11 to be so that way when the equation is run it will apply to every cell in the I column instead of just I 11
Sub DeleteNow()
Dim Firstrow As Long
Dim Lastrow As Long
Dim Lrow As Long
Dim CalcMode As Long
Dim ViewMode As Long
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
With Sheets("Copy")
.Select
ViewMode = ActiveWindow.View
ActiveWindow.View = xlNormalView
.DisplayPageBreaks = False
Firstrow = .UsedRange.Cells(1).Row
Lastrow = .UsedRange.Rows(.UsedRange.Rows.Count).Row
For Lrow = Lastrow To Firstrow Step -1
With .Cells(Lrow, "I")
If Not IsError(.Value) Then
If ******************** Then .EntireRow.Delete
End If
End With
Next Lrow
End With
ActiveWindow.View = ViewMode
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub
EDIT: Use this as a basis to get started.
You can remove unnecessary code generated by the macro recorder.