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

Hello all, I have a sub that is failing on one line and I am not sure
why. The line is
selection.autofilter field:=6, criteria1:= "500"
the error that I get is autofilter method of range class failed. The
sub is fairly big, that is why I am only posting the one line. if I end
the sub when it fails here I can go and filter the list based on this
exact same criteria. I have used the recorder to make sure that the
line is coded properly. I seems to match what the recorder gives me. Is
there something special that I need to do when using it in code when
comared to doing it manually or recording it?
If more code is needed please let me know and I will post.
Thanks in advance for any help that anyone can provide.
Thanks Terry

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Autofilter method of range class failed

Sorry let's post the complete line that fails
Selection.AutoFilter field:=6, criteria:="500", Operator:=xlAnd
Thanks Terry

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Autofilter method of range class failed

Here is what I recored and what you posted:

Selection.AutoFilter field:=6, Criteria1:="500", Operator:=xlAnd
Selection.AutoFilter field:=6, criteria:="500", Operator:=xlAnd

See the difference. Your argument is Criteria, but the correct argument is
Criteria1

--
Regards,
Tom Ogilvy


"Terry K" wrote in message
oups.com...
Sorry let's post the complete line that fails
Selection.AutoFilter field:=6, criteria:="500", Operator:=xlAnd
Thanks Terry



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Autofilter method of range class failed

Sorry about that, my first post I missed the last qualifier and my
second post I missed the 1 - duhh. My code did actaully have the one in
it but it still does fail. Any ideas as to what I can try to determine
why it is failing?
Thanks Terry

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Autofilter method of range class failed

Sheet protected.

Selection doesn't include 6 columns

I guess it could be a number of things, but I have never had a problem with
it when it is applied to an appropriate range.

--
Regrds,
Tom Ogilvy


"Terry K" wrote in message
oups.com...
Sorry about that, my first post I missed the last qualifier and my
second post I missed the 1 - duhh. My code did actaully have the one in
it but it still does fail. Any ideas as to what I can try to determine
why it is failing?
Thanks Terry





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Autofilter method of range class failed

Not sure either. It does have many more than 6 columns and it is not
protected. I am not sure either. If I ever do get it figured out I will
post what the result was. Thanks for the help. Terry

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
Autofill method of range class failed Don Guillett Excel Discussion (Misc queries) 0 February 27th 08 03:56 PM
Autofill method of range class failed Appache Excel Discussion (Misc queries) 5 February 27th 08 03:37 PM
Delete method of Range class failed - HELP!!! richilli Excel Programming 1 October 20th 04 06:24 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 07:08 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"