Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default whats wrong with my macros

I have two buttons the first calls on this macro which I recorded

Sheets("FILES SENT").Selec
Selection.AutoFilter Field:=10, Criteria1:="OK Case
ActiveWindow.SmallScroll ToRight:=-
Selection.AutoFilter Field:=5, Criteria1:="=*house*"
Operator:=xlOr,
Criteria2:="=*workflow*

The macro is supposed to use two filters in columns J(ie-10) an
5(ie-E), but I get a messag
Run time error "1004"
Autofilter mehod of Range class failed

Similarly I have another button which would show all the record
again,

Sheets("FILES SENT").Selec
Selection.AutoFilter Field:=1
Selection.AutoFilter Field:=
Range("A2").Selec

Again the error shows, where am I going wrong, I'm using Office 97

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default whats wrong with my macros

Hi

Three suspects:
Your active cell is outside the list to filter ? If so, add
Range("A2").Select before the Autofilter command. No, do it anyway.

FILES SENT is protected ?

Excel97 error: The button has its TakeFocusOnClick property set to True ? My
main suspect, this one.

HTH. Best wishes Harald

"cribology - ExcelForums.com"
skrev i melding
...
I have two buttons the first calls on this macro which I recorded:

Sheets("FILES SENT").Select
Selection.AutoFilter Field:=10, Criteria1:="OK Case"
ActiveWindow.SmallScroll ToRight:=-5
Selection.AutoFilter Field:=5, Criteria1:="=*house*",
Operator:=xlOr, _
Criteria2:="=*workflow*"

The macro is supposed to use two filters in columns J(ie-10) and
5(ie-E), but I get a message
Run time error "1004"
Autofilter mehod of Range class failed.

Similarly I have another button which would show all the records
again,

Sheets("FILES SENT").Select
Selection.AutoFilter Field:=10
Selection.AutoFilter Field:=5
Range("A2").Select

Again the error shows, where am I going wrong, I'm using Office 97.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default whats wrong with my macros

Thanks, its looks like I didn't identify the range which caused the
problem.

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
whats wrong with this? brownti via OfficeKB.com Excel Discussion (Misc queries) 10 February 12th 07 02:39 PM
Whats wrong with this? LucasBuck Excel Discussion (Misc queries) 3 January 12th 06 08:15 PM
Whats wrong with this code? Joseph[_54_] Excel Programming 2 November 26th 04 04:31 PM
Whats Wrong with this?? drvortex Excel Worksheet Functions 1 October 30th 04 06:48 PM
Whats wrong? Lee Excel Programming 0 July 14th 04 05:04 PM


All times are GMT +1. The time now is 07:34 PM.

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

About Us

"It's about Microsoft Excel"