Auto filter method of range class failed with Criteria

Set rmdvsheet = ActiveWorkbook.Sheets(11) rmdvsheet.Range("A1:K103").AutoFilter Field:=10, Criteria1:= _ "D7u L462-L494 17MY" 

Here on 2nd line i am geting an error saying "Auto filter method of range class failed".

3 Answers

Your problem is with the range you've defined. The autofilter only wants referral to the header row. If you sub this into your code, it should work the way you expect (the only change is in the range from K103 to K1"):

rmdvsheet.Range("A1:K1").AutoFilter Field:=10, Criteria1:="D7u L462-L494 17MY" 

I had the same problem. If you are turned to the right sheet and no other syntax error. It's because maybe in the original sheet, it is already autofiltered. Like in the following picture. To solve this, just click the filter button to return to the unfilter status. 1

1

Make sure you have the correct worksheet.

Make sure the data in the sheet cells have no double quotes. Like:

see it

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like