Boolean
The boolean data type can contain either the value True or False.
This data type uses 2 bytes.
The keywords True and False are built-in constants.
The default value is False (or zero).
Any value that is not equal to zero is equivalent to True.
True = -1
False = 0
A boolean variable is often used to check the condition in an If-Then-Else statement.
Dim bMyValue As Boolean 'defaults to False
bMyValue = True
If (bMyValue = True) Then
Call Msgbox("true")
Else
Call MsgBox("false")
End If
Call MsgBox(VBA.CInt(True))
Call MsgBox(VBA.CInt(False))
Conversion Function
The CBOOL function returns an expression converted to an boolean data type.
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext