Re: Shorter 'Or' Statement?
- From: "Peter T" <peter_t@discussions>
- Date: Mon, 28 Apr 2008 17:31:12 +0100
With your example you could reduce your Or's if you use UCase.
s = UCase(Range("B" & CurRow))
Also faster to assign the value to a variable rather than reading the cell
multiple times.
Maybe 'Like' might work for you
If Range("B" & CurRow) Like "[OXox]" then
or
If Ucase("B" & CurRow) Like "[OX]" then
Regards,
Peter T
"Bigfoot17" <Bigfoot17@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B739F01C-E734-4865-8A3E-13D8F230CB51@xxxxxxxxxxxxxxxx
I have the following line working, but it seems that perhaps the linecould
be shortened:adding
If Range("B" & CurRow) = "X" Or Range("B" & CurRow) = "x" Or Range("B" &
CurRow) = "O" Or Range("B" & CurRow) = "o" Then
If I needed to add a few more acceptable characters would I continue
more 'or' statements or can I try another method?
Thanks.
.
- Follow-Ups:
- Re: Shorter 'Or' Statement?
- From: JE McGimpsey
- Re: Shorter 'Or' Statement?
- References:
- Shorter 'Or' Statement?
- From: Bigfoot17
- Shorter 'Or' Statement?
- Prev by Date: Re: Shorter 'Or' Statement?
- Next by Date: Re: modifying countifs
- Previous by thread: Re: Shorter 'Or' Statement?
- Next by thread: Re: Shorter 'Or' Statement?
- Index(es):
Relevant Pages
|