Happy Friday!
I'm attempting to create VBA code that allows users to use an Input Box to enter dates for filtering. So far I'm able to add one input box for the Start Date but had trouble when I tried entering the other box for the End Date. The column would ideally filter by the dates entered. Additionally, I need to filter by other set criteria below (bottom two lines of code before End With) & I found the code below doesn't use all text options listed in the Arrays. I'm pretty sure it's because I'm leaving something out. I appreciate any help in advance. THANK YOU!!
Code I have so far:
Dim ap, dt As Date, dt1 As Date
With Worksheets("TestWorkbook").Range("A1")
ap = Application.InputBox("Start Date")
dt = CDate(ap)
.AutoFilter 5, ">=" & dt
.AutoFilter field:=6, Criteria1:=Array("CLIENT1", "CLIENT2", "CLIENT3")
.AutoFilter field:=7, Criteria1:=Array("MS", "VA")
End With
I'm attempting to create VBA code that allows users to use an Input Box to enter dates for filtering. So far I'm able to add one input box for the Start Date but had trouble when I tried entering the other box for the End Date. The column would ideally filter by the dates entered. Additionally, I need to filter by other set criteria below (bottom two lines of code before End With) & I found the code below doesn't use all text options listed in the Arrays. I'm pretty sure it's because I'm leaving something out. I appreciate any help in advance. THANK YOU!!
Code I have so far:
Dim ap, dt As Date, dt1 As Date
With Worksheets("TestWorkbook").Range("A1")
ap = Application.InputBox("Start Date")
dt = CDate(ap)
.AutoFilter 5, ">=" & dt
.AutoFilter field:=6, Criteria1:=Array("CLIENT1", "CLIENT2", "CLIENT3")
.AutoFilter field:=7, Criteria1:=Array("MS", "VA")
End With