Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default AutoFilter method of Range class failed

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default AutoFilter method of Range class failed

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.

"blopreste3180" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofilter method of range class failed Terry K Excel Programming 5 October 18th 05 03:09 AM
What did I do? (Select Method of Range Class Failed ) HotRod Excel Programming 9 May 20th 05 02:11 PM
select method of range class failed Joseph[_38_] Excel Programming 1 September 28th 04 03:21 PM
Insert method of range class failed DJH Excel Programming 0 August 17th 04 07:30 PM
AutoFilter method of Range Class Failed Randy Reese Excel Programming 3 April 3rd 04 04:34 AM


All times are GMT +1. The time now is 11:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"