Visual Basic and Visual Basic for Applications support the following data types:
Indicates the presence of logical data that can contain either of two values, True or False. The keywords True and False are constants that are predefined in VBA, so you can make use of them in your code when you want to assign a value to a Boolean variable, as the following code fragment shows:
var1 = True var2 = False
Many of the properties of ActiveX controls have possible values of True or False. In addition, within programs, Boolean variables often serve as flags to control program flow, as the following example, which toggles (or reverses) the value of myBool within the If...Else...End If construct, shows:
If myBool = False Then myVar = 4 myBool = True Else myVar = 5 myBool = False End If
True or False
The smallest numeric subtype available in VBA. Because only one byte holds a number ranging from to 255 (or 00 to FF in hexadecimal), there is no room for the sign, and so only positive numbers can be held in a Byte data type. Attempting to assign a negative number or a number greater than 255 to byte data results in a runtime error.
0 to 255
Provides a special numeric format for storing monetary values.
–922,337,203,685,477.5808 to 922,337,203,685,477.5807
Contains a specially formatted ...