Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you for your continued help Don. It must be so satisfying to be such a
clever guy! A great big hug to you. Lorna "Don Guillett" wrote: Lorna, See my answer in your original post. Your macro below does not make a selection to filter. Try this. Range("A3").CurrentRegion.Clear Sheets("Satisfaction input sheet").Select Range("A4").CurrentRegion.Copy Sheets("query").Range("A3") c1 = InputBox("Enter Date From") c2 = InputBox("Enter Date To") With sheets("query").Range("A3:D7")' adjust to suit .AutoFilter .AutoFilter Field:=1, Criteria1:="=" & c1 & "" _ , Operator:=xlAnd, Criteria2:="<=" & c2 & "" End With End Sub -- Don Guillett SalesAid Software "Lorna B" wrote in message ... 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 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Oh, we like hugs. Did it work for you?
-- Don Guillett SalesAid Software "Lorna B" wrote in message ... Thank you for your continued help Don. It must be so satisfying to be such a clever guy! A great big hug to you. Lorna "Don Guillett" wrote: Lorna, See my answer in your original post. Your macro below does not make a selection to filter. Try this. Range("A3").CurrentRegion.Clear Sheets("Satisfaction input sheet").Select Range("A4").CurrentRegion.Copy Sheets("query").Range("A3") c1 = InputBox("Enter Date From") c2 = InputBox("Enter Date To") With sheets("query").Range("A3:D7")' adjust to suit .AutoFilter .AutoFilter Field:=1, Criteria1:="=" & c1 & "" _ , Operator:=xlAnd, Criteria2:="<=" & c2 & "" End With End Sub -- Don Guillett SalesAid Software "Lorna B" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
runtime error 1004 HELP PLS | Excel Discussion (Misc queries) | |||
What causes runtime error 1004? | Excel Discussion (Misc queries) | |||
runtime error 1004 | Excel Discussion (Misc queries) | |||
runtime error 1004 | Excel Discussion (Misc queries) | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) |