Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
correct use of OR statement
#2
Not Solved
I think the below logic works for you. Usually when your are using the same variable mutliple times in a condition, you should use AND.
See the code below:

Code:
MyCheck =8
If MyCheck <> 8 AND MyCheck<> 1 AND MyCheck<> 9 AND MyCheck<> 0 Then
  MsgBox "Mycheck<>8"
ElseIF MyCheck = 1 AND MyCheck = 0 AND MyCheck = 9 Then
  MsgBox "MyCheck=1"
ElseIf MyCheck = 8 Then
  MsgBox "Success"
End If
Reply


Messages In This Thread
correct use of OR statement - by lotos - 06-02-2011, 01:15 PM
RE: correct use of OR statement - by sundari.msls - 06-02-2011, 02:41 PM
RE: correct use of OR statement - by lotos - 06-02-2011, 02:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Executing statement and commiting statement via qtp unbeliever 6 20,503 01-07-2010, 07:11 PM
Last Post: unbeliever
  Is the split array method the correct tool for the job? qatestbrian 0 2,091 01-06-2010, 02:06 AM
Last Post: qatestbrian
  How to select correct list? rahul1234 1 2,333 10-14-2009, 12:55 PM
Last Post: Saket
Exclamation How to chk alert given is correct or not. mayur.bidkar 1 1,876 11-07-2008, 02:40 PM
Last Post: MR21135

Forum Jump:


Users browsing this thread: 1 Guest(s)