help on Autofilter

can an Expert help me out with this

I have code that autofilters then does some copying and pasting the first part of the code is

Dim myRange
ActiveSheet.Range("$A:$T").AutoFilter Field:=18, Criteria1:="<=15"

then I need to loop this to autofilter on Field 20 but I realise I can't use

ActiveSheet.Range("$A:$T").AutoFilter Field:=20, Criteria1:="<=15"

as I get Autofilter method of Range class failed.

Who is Participating?
Phillip BurtonConnect With a Mentor Director, Practice Manager and Computing ConsultantCommented:
It works for me (see attached).
JagwarmanAuthor Commented:
That is very bizzare. as you say it works in your spreadsheet but not in mine I will have to investigate further
Phillip BurtonDirector, Practice Manager and Computing ConsultantCommented:
Maybe post your spreadsheet.

Is there a heading in cell S1 (i.e. is the table continuous)?
JagwarmanAuthor Commented:
Hi Phillip

thanks for the use of your brain. Not sure what it was but by removing the filters completely and then running the code it works.

Have a good Xmas
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.