AutoFilter method of Range class failed

G

Guest

HELP QUICK!
I am trying to set an autofilter macro so when a user presses a button in a
worksheet, it automatically filters the data in a separate sheet. Here is my
code abbreviated (removed many range lines)
Selection.AutoFilter Field:=2, Criteria1:="19A"
ActiveWindow.LargeScroll ToRight:=7
ActiveWindow.ScrollColumn = 91
NOTE: (many activewindow.scrollcolumn=#'s left out)
ActiveWindow.SmallScroll Down:=3
ActiveWindow.SmallScroll ToRight:=3
ActiveWindow.SmallScroll Down:=-12
ActiveWindow.SmallScroll ToRight:=-3
Range("B53").Select
ActiveWindow.FreezePanes = True
ActiveWindow.SmallScroll ToRight:=7
Range("U53:U127").Select
Range("U127").Activate
ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,R[-74]C:R[-1]C)"
Range("U53:U127").Select
ActiveWindow.SmallScroll ToRight:=152
Range("FH53:FH127").Select
Range("FH127").Activate
ActiveCell.FormulaR1C1 = "=SUBTOTAL(9,R[-74]C:R[-1]C)"
Range("FH53:FH127").Select
ActiveWindow.LargeScroll ToRight:=3
ActiveWindow.ScrollColumn = 192
NOTE (many activewindow.scrollcolumn=#'s left out)
Range("A53").Select

I am trying to get this button to work and am on a tight deadline, quick
help is certainly appreciated.
End Sub
 
G

Guest

I see a lot of activewindow, but have you ever declared your activesheet? I
see a lot of macros using ranges fail because the sheet has never been set
active.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top