One of these two:
Sub Filter()
Dim UseEnt As String
Dim strUserInput As String
Sheets("Sheet3").Activate
ActiveSheet.AutoFilterMode = False
Application.CutCopyMode = False 'you don't need this, unless you have performed copy paste somewhere else in the code
strUserInput = InputBox("Enter the number of days for the search.")
Select Case strUserInput
Case vbNullString
Exit Sub
Case Else
If IsNumber(strUserInput) Then
UseEnt = Date - CInt(strUserInput)
Range("A2").CurrentRegion.AutoFilter Field:=3, Criteria1:="<=" & UseEnt
End If
End Select
End Sub
OR
Sub Filter()
Dim UseEnt As String
Dim strUserInput As String
Sheets("Sheet3").Activate
ActiveSheet.AutoFilterMode = False
Application.CutCopyMode = False 'you don't need this, unless you have performed copy paste somewhere else in the code
strUserInput = InputBox("Enter the number of days for the search.")
If strUserInput <> vbNullString Then
If IsNumber(strUserInput) Then
UseEnt = Date - CInt(strUserInput)
Range("A2").CurrentRegion.AutoFilter Field:=3, Criteria1:="<=" & UseEnt
End If
End If
End Sub
Bookmarks