Re: if with or



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 I
want to use if with or (i know this works but i have forgotten the code).
Eg

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!




.