Hello all
Please help in debugging this code
With this code, I want to filter one of the columns in my table that contains a date.
Using the input box to specify the start date and end date
Please help in debugging this code
With this code, I want to filter one of the columns in my table that contains a date.
Using the input box to specify the start date and end date
VBA Code:
Sub TEST()
Dim StartDate As Date, EndDate As Date
StartDate = Application.InputBox(MsgGP, TitleMsg, FormatDateTime(Date, vbShortDate), Type:=1)
EndDate = Application.InputBox(MsgGP, TitleMsg, FormatDateTime(Date, vbShortDate), Type:=1)
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=4, _
Criteria1:=">=" & StartDate, _
OOperator:=xlAnd, _
Criteria2:="<=" & EndDate
End Sub