Instead to use multiple if...end to intercept a value for condition is possible to check if value is present in a strng array???
example:
if AA
is this array (AA,AB, AC,......ZZ)
then
i hope you understabd me:-)
CHECK if value is in ????
-
- Administrator
- Posts: 78615
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: CHECK if value is in ????
You could use
Code: Select all
Dim MyVar As String
MyVar = ...
Select Case MyVar
Case "AA", "AB", "AC", "ZZ"
' Do something
Case Else
' Do something else
End Select
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4368
- Joined: 26 Apr 2010, 17:36
Re: CHECK if value is in ????
HansV wrote:You could use
Code: Select all
Dim MyVar As String MyVar = ... Select Case MyVar Case "AA", "AB", "AC", "ZZ" ' Do something Case Else ' Do something else End Select