• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Help: VBA code to uncheck more than 3 values from Filter

Mahantesh

Member
Hi Guru's,

I have below table. I need VBA code to uncheck the TAX, ONLINE and FREIGHT from filter.

upload_2016-11-16_16-39-3.png

I tried by putting Criteria in Autofilter range. But failed as VBA does allow more than 2 criteria in Autofilter method.

Can anyone please help me and solving this VBA code to uncheck more than 3 values?

Regards,
Mahantesh
__________________________________________________________________
Mod edit : thread moved to appropriate forum !
 
@Mahantesh

I saw you posted in the other thread but I believe it is best if we keep things separate as mixing may cause some confusion if someone comes looking for that specific solution:

In your case, with table in columns A:B and criteria in column H, you can use the following code:
Code:
Sub Macro()

    Dim lrow As Integer
    lrow = Columns("H").Cells(Rows.Count).End(xlUp).Row

    Columns("A:B").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
        ActiveSheet.Range("H1:H" & lrow), Unique:=False

End Sub

Please see attached

Regards
 

Attachments

  • Testfilter.xlsm
    17.6 KB · Views: 19
Back
Top