Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry let's post the complete line that fails
Selection.AutoFilter field:=6, criteria:="500", Operator:=xlAnd Thanks Terry |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Autofill method of range class failed | Excel Discussion (Misc queries) | |||
Autofill method of range class failed | Excel Discussion (Misc queries) | |||
Delete method of Range class failed - HELP!!! | Excel Programming | |||
Insert method of range class failed | Excel Programming | |||
AutoFilter method of Range Class Failed | Excel Programming |