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
 

Some videos you may like

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

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.
 

Watch MrExcel Video

Forum statistics

Threads
1,119,128
Messages
5,576,259
Members
412,709
Latest member
Rishu
Top