View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dan Thompson Dan Thompson is offline
external usenet poster
 
Posts: 125
Default Conditional "If Not ... Then" Statement not working properly Help!

There is a correction with the original post a small typo but it still is not
working once I fix the typo

Sub test()
Dim one As Boolean, two As Boolean, three As Boolean
one = True
two = True
three = False

If Not one = True And Not two = True And Not three = True Then
MsgBox "One or more of the 3 conditions are false"
End If
End Sub


"Dan Thompson" wrote:

The following code should pop up a message box but it is not doing so where
am I going wrong ?


Sub test()
Dim one As Boolean, two As Boolean, three As Boolean
one = True
two = True
three = False

If Not one = True And Not two = True And Not three = False Then
MsgBox "One or more of the 3 conditions are false"
End If
End Sub

Dan Thompson