Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IF.. OR

Status
Not open for further replies.

dukkse

Technical User
Oct 15, 2003
42
US
Hey!

I have this code, and it gives me an error.
Basicly, I am scanning our AD for servers whoose name starts with either RET or ITU. But I an error on the IF row.

Here is the script

servername = "RET100"
If ucase(Left(servername,3)) = "ITU" Or "RET" Then MsgBox "Good"

And this is the error.
Type mismatch: '[string: "RET"]'

How can I get the IF function to check for 2 things, without having 2 IF functions???

Thanks
Daniel
 
If UCase(Left(servername,3)) = "ITU" Or UCase(Left(servername,3)) = "RET" Then MsgBox "Good"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Worked great.. Thanks. Can't belive I did not think about that..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top