G
Guest
I have a macro that invokes Autofilter, however, when I try to run it, after
receiving input from the user, it fails at the Autofilter command. The
message is Autofilter method of range class failed. Can someone help me with
this? This is the entire macro from the start where it selects a range and
clears it, then selects the range for the filter.
Range("A3").Select
Selection.CurrentRegion.Select
Selection.Clear
Sheets("Satisfaction input sheet").Select
Range("A4").Select
Selection.CurrentRegion.Select
Selection.Copy
Sheets("query").Select
Range("A3").Select
ActiveSheet.Paste
Application.CutCopyMode = False
c1 = InputBox("Enter Date From")
c2 = InputBox("Enter Date To")
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=">=" & c1 & ",",
Criteria2:="<=" & c2
Range("A3").Select
receiving input from the user, it fails at the Autofilter command. The
message is Autofilter method of range class failed. Can someone help me with
this? This is the entire macro from the start where it selects a range and
clears it, then selects the range for the filter.
Range("A3").Select
Selection.CurrentRegion.Select
Selection.Clear
Sheets("Satisfaction input sheet").Select
Range("A4").Select
Selection.CurrentRegion.Select
Selection.Copy
Sheets("query").Select
Range("A3").Select
ActiveSheet.Paste
Application.CutCopyMode = False
c1 = InputBox("Enter Date From")
c2 = InputBox("Enter Date To")
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=">=" & c1 & ",",
Criteria2:="<=" & c2
Range("A3").Select