NOT

result = NOT expr

The logical 'NOT' operator (Boolean).


exprThe expression to negate evaluating to either True or False (Boolean).

REMARKS
* This is an Operator.
* You can use the AND operator for logical and.
* You can use the OR operator for logical or.
* You can use the XOR operator for logical exclusion.
* The equivalent Excel function is Application.WorksheetFunction.NOT
* For the Microsoft documentation refer to learn.microsoft.com

Debug.Print Not True     '= False  
Debug.Print Not False '= True
Debug.Print Not 0 '= -1
Debug.Print Not 1 '= -2
Debug.Print Not -1 '= 0
Debug.Print Not 10 '= -11
Debug.Print Not -10 '= 9
Debug.Print Not (2 = 2) '= False
Debug.Print Not 1 = 2 '= True
Debug.Print Not Null '= Null

Dim iValue As Integer
If Not (iValue = 5) Then
End If

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top