Hi Folks
I am trying to use an Input Box to filter results on a seperate non-active Sheet. (ExportData). I get the error as mentioned in the title and the debug points to line 7. .Autofilter Field:=5.....
My VBA code is mostly 'borrowed' from elsewhere, so I'm not 100% sure what I've got wrong
Any assistance is greatly appreciated. Thank you.
I am trying to use an Input Box to filter results on a seperate non-active Sheet. (ExportData). I get the error as mentioned in the title and the debug points to line 7. .Autofilter Field:=5.....
My VBA code is mostly 'borrowed' from elsewhere, so I'm not 100% sure what I've got wrong
VBA Code:
Option Explicit
Public Sub Filter()
Application.ScreenUpdating = False
Dim strName As String
strName = InputBox("Please enter required date")
With Sheets("ExportData").Range("$A$1:$Z$1000")
.AutoFilter Field:=7, Criteria1:="*" & strName & "*"
.AutoFilter
End With
Application.ScreenUpdating = True
End Sub
Any assistance is greatly appreciated. Thank you.