Re: if with or
- From: "NickHK" <TungCheWah@xxxxxxxxxxx>
- Date: Tue, 17 Apr 2007 15:47:41 +0800
Arne,
For the example you have shown:
If (A(i) = "AAA") or (A(i) ="Aaa") Then
The brackets are not required, but I find they clarify what is being
assessed.
But you could also:
If LCase(A(i)) = "aaa" Then
if that is your aim.
Or possibly look at Regular Expressions if the patterns are more
complicated.
NickHK
"Arne Hegefors" <ArneHegefors@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CA0682F9-EC4E-4485-A50B-4570CCEF595E@xxxxxxxxxxxxxxxx
hi! I have to use very many if ...end if in my code. to save some space IEg
want to use if with or (i know this works but i have forgotten the code).
If A(i) = "AAA" Then
A(i) = 1
if A(i) = "Aaa" Then
A(i) = 1
End If
end if
instead i want to have:
If A(i) = "AAA" or "Aaa" Then
A(i) = 1
End If
but i have forgotten how it is written. please help me!
.
- Prev by Date: Re: msQuery: is JOIN command possible in Excel?
- Next by Date: Re:Loop Through Array Copy/Paste Value into VBA Code
- Previous by thread: Re: msQuery: is JOIN command possible in Excel?
- Next by thread: Using an excel addin to call macros in current ***.
- Index(es):