Hi all,

As part of a larger macro which performs custom autofiltering using a shortcut key I am trying to use an "Or" operator in one of my "case is" lines.

Currently I have the following code which is used after identifying that the left character of the "InitialFilterValue" (dimmed as a string & sourced from an input box) is "<".

Select Case Left(InitialFilterValue, 2)
Case Is = "<>"
GoTo MakeStringPrefixDoubleLeft
Case Is = "<="
GoTo MakeStringPrefixDoubleLeft
Case Else
GoTo MakeStringPrefixSingleLeft
End Select

In the interests of optimising my code & because the first two cases have the same action, is it possible to combine the first two cases using something like...
" Case is = "<>" Or "<=" "?

FYI, when I try the above line I get the error message "Run time error: 13 type mismatch". I've dimmed InitialFilterValue as a string because there will be other situations when I am attempting to filter text strings.


Also in the interests of optimising my complete code is anyone interested in reviewing it & making suggestions?

btw, it is not as complete as Ron DeBruin's "easy filter" http://www.rondebruin.nl/easyfilter.htm
but it is quick & effective (apart from dates, which can still sometimes cause issues) wrt what I need - a keyboard activated custom filter.

I'll try any suggestions when I get a chance in the morning,
Thanks in advance,

Rob Brockett
NZ
Always learning & the best way to learn is to experience...