date dependent array??

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
2,007
Office Version
  1. 365
Platform
  1. Windows
I currently use this little snippet of code to filter my data set by Contract Status.

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?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,215,212
Messages
6,123,653
Members
449,111
Latest member
ghennedy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top