Advanced Filter VBA

Genzz

New Member
Joined
Jun 17, 2005
Messages
22
Hi All
I to need filter in more than 2 conditions in same column, I tried advanced filter I didn't get anywhere mainly because my conditions are:
Non Blank
Does Not Begin With
Does Not End With
Does Not Contain
I don't how to make these conditions in advanced filter at the same time.


I tried recording a macro and editing but no joy. I am using the following code.

Code:
Sub Filter3()

    Range("A8").Select
    Selection.AutoFilter
    Selection.AutoFilter Field:=29, Criteria1:="<>", Criteria2:="<>^*", _
    Criteria3:="<>*^", Criteria4:="<>*^^*"
    Range("A8").Select

End Sub

Any suggestions please?

Many Thanks
Genzz
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Von Pookie

MrExcel MVP
Joined
Feb 17, 2002
Messages
13,686
Your code is for the autofilter, not advanced filter--they are two separate things. The code you posted won't work because you are limited to 2 criteria with autofilter.

Brian gave you some tips on how to use the advanced filter in your previous thread--have you read them?
http://www.mrexcel.com/board2/viewtopic.php?t=181377
 

Genzz

New Member
Joined
Jun 17, 2005
Messages
22
Hi
Thanks for the reply.
Yes I have read Brians tips and the advanced filter work the criteria is equal to certain values. But is doesent work when I try the follwing criteria.

<> (Non Blank)
"<>A*" (Does Not Begin with "A")
"<>*A" (Does Not End with "A")
"<>*AA*" (Does Not Contain "AA")
I need to filter on those 4 conditions.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,631
Messages
5,832,768
Members
430,166
Latest member
Nige Leeming

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top