How do I define "contains' as the default custom filter?

J

J Engineer

How do I define "Contains" as the default custom filter criteria or make it
fist in the pulldown choice?
 
D

Dave Peterson

I don't think you can.

But you can use equals and then do some typing:

equals *engineer*
is equivalent to contains engineer

equals *eer
(ends with eer)

equals eng*
(starts with eng)

(I find typing quicker than using that too small dropdown--just a bit larger to
make it fit all the options and it would have been nicer.)
 
G

Gord Dibben

J

You can't.

The next best is to have a macro such as below. No error trapping.

Sub contains()
Dim Rng As Range
Set Rng = Application.InputBox(prompt:="Select Column to Filter", _
Title:="Auto Filter", Type:=8)
pick = InputBox("enter a value or string." & Chr(13) _
& " Wildcards * can be used")
Rng.AutoFilter
Rng.AutoFilter Field:=1, Criteria1:=pick, Operator:=xlAnd
End Sub


Gord Dibben Excel MVP

On Wed, 14 Sep 2005 11:51:01 -0700, "J Engineer" <J
 
Top