LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can I use "or" in a select case construct?


Hi all,

As part of a larger macro which performs custom autofiltering using
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 identifyin
that the left character of the "InitialFilterValue" (dimmed as a strin
& 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 case
have the same action, is it possible to combine the first two case
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 becaus
there will be other situations when I am attempting to filter tex
strings.


Also in the interests of optimising my complete code is anyon
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 stil
sometimes cause issues) wrt what I need - a keyboard activated custo
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..

--
broro18
-----------------------------------------------------------------------
broro183's Profile: http://www.excelforum.com/member.php...fo&userid=3006
View this thread: http://www.excelforum.com/showthread.php?threadid=51909

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I count only lower case "x" and exclude upper case "X" jbeletz Excel Worksheet Functions 3 October 14th 06 10:50 PM
Why Error Message "End Select without Select Case"? GoFigure[_13_] Excel Programming 5 December 9th 05 12:26 AM
SELECT CASE "Jan-03" confusion Craigm[_13_] Excel Programming 2 June 27th 05 02:40 PM
Fix Code: Select Case and "Contains" selection Bettergains Excel Programming 5 April 26th 05 02:22 AM
Problem with Select Case construct? Chris Bromley[_2_] Excel Programming 1 April 12th 05 08:27 PM


All times are GMT +1. The time now is 01:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"