I currently use this little snippet of code to filter my data set by Contract Status.
I wish to limit the Complete contracts only to only those completed in the last three months but am not sure how to do that. The data upon which this macro runs has an End Date field.
any suggestions?
Code:
Sub FilterRowsOR()
'macro to filter Contracts download from Tech 1,calculated price performance review, and P6 Primavera download
'downloads must be done manually at this stage
With Application
.ScreenUpdating = False ' stop screen flashing as macro runs
.DisplayAlerts = False ' stop alert messages
.EnableEvents = False ' disable events running
End With
With Worksheets("T1 Download")
'check for filter, turn on if none exists
If Not .AutoFilterMode Then
.Range("A5").AutoFilter
End If
End With
With Worksheets("T1 Download")
'apply filter to include only Approved and Draft to Contract Status
.ListObjects("Table1").Range.AutoFilter Field:=8, Criteria1:= _
Array("Approved", "Draft", "Complete"), Operator:=xlFilterValues
'apply filter to include listed array Phases
.ListObjects("Table1").Range.AutoFilter Field:=9, Criteria1:= _
Array("Pending", "Prework", "Sourcing", "Work in Progress", "Under Evaluation"), Operator:=xlFilterValues
End With
I wish to limit the Complete contracts only to only those completed in the last three months but am not sure how to do that. The data upon which this macro runs has an End Date field.
any suggestions?