Jed Shields
Active Member
- Joined
- Sep 7, 2011
- Messages
- 283
- Office Version
- 365
- Platform
- Windows
Hi guys,
I need a little help with some code I'm writing. I'm trying to filter a list between two dates that are selected using drop down lists in Cells CZ1 and CZ2.
The first part of the code works ok ie it filters the list by column 28 as "Shipped" only.
The second part is causing me trouble.
The third part sorts the list by date order based on column 48 and this also works ok.
It's not very pretty as I've been copying from various posts online.
Cheers,
Jed.
I need a little help with some code I'm writing. I'm trying to filter a list between two dates that are selected using drop down lists in Cells CZ1 and CZ2.
The first part of the code works ok ie it filters the list by column 28 as "Shipped" only.
The second part is causing me trouble.
The third part sorts the list by date order based on column 48 and this also works ok.
Code:
[FONT=Arial][SIZE=2]Sub FilterTransactionDates()[/SIZE][/FONT]
[FONT=Arial][SIZE=2] With Sheet1
.AutoFilterMode = False
.Range("A1:CU1").AutoFilter
.Range("A1:CU1").AutoFilter Field:=28, Criteria1:="Shipped"
.Range("A1:CU1").AutoFilter Field:=48, Criteria1:>=Range("CZ1").Value, Operator:= _
xlAnd, Criteria2:<range("cz2").value
' Selection.Sort Key1:=Range("CT3"), Order1:=xlAscending, Header:=xlGuess, _
' OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End With
End Sub</range("cz2").value
[/SIZE][/FONT]
Cheers,
Jed.