tonywatsonhelp
Well-known Member
- Joined
- Feb 24, 2014
- Messages
- 3,210
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Hi Everyone
I have this macro to filter dates but I need to be able to combine the two so it does both things
So basicly it currently chages the filter to just
"Sheets("PropPDD").Range("$A$2:$J$10000").AutoFilter Field:=1, Criteria1:="<=" & EndM"
I need it to do both?
I have this macro to filter dates but I need to be able to combine the two so it does both things
So basicly it currently chages the filter to just
"Sheets("PropPDD").Range("$A$2:$J$10000").AutoFilter Field:=1, Criteria1:="<=" & EndM"
I need it to do both?
Code:
StartM = Sheets("Dashboard Data1").Range("B12").Value
EndM = Sheets("Dashboard Data1").Range("B14").Value
If StartM <> 0 Then
Sheets("PropPDD").Range("$A$2:$J$10000").AutoFilter Field:=1, Criteria1:=">=" & StartM
Else
Sheets("PropPDD").Range("$A$2:$J$10000").AutoFilter Field:=1, Criteria1:=">=01/01/2014"
End If
If EndM <> 0 Then
Sheets("PropPDD").Range("$A$2:$J$10000").AutoFilter Field:=1, Criteria1:="<=" & EndM
End If