


Purpose
And Operator
| If expr1 is
| And expr2 is
| result is
|
| true (nonzero)
| true
| True (-1)
|
| true
| false (0)
| False (0)
|
| true
| Null
| Null
|
| false
| true
| False
|
| false
| false
| False
|
| false
| Null
| False
|
| Null
| true
| Null
|
| Null
| false
| False
|
| Null
| Null
| Null
|
| If bit in expr1 is
| And bit in expr2 is
| result is
|
| 0
| 0
| 0
|
| 0
| 1
| 0
|
| 1
| 0
| 0
|
| 1
| 1
| 1
|
Example
This example prints a message that depends on the value of variables A, B, and C, assuming that no variable is a Null. If A = 10, B = 8, and C = 6, both expressions evaluate True. Because both expressions are True, the And expression is also True.
If A > B And B > C Then
Debug.Print "Both expressions are True."
Else
Debug.Print "One or both expressions are False."
End If