You use a Boolean data type to store a value of True or False. A Boolean data type takes two bytes of data storage. Programmers use Boolean data when working with logical data. VBA predefines the keywords True and False as Boolean values. To assign them to a variable, you simply specify the value BoolValue = True.

You should not use quotes when assigning a Boolean value. When you place quotes around the word True, VBA treats the variable as a string instead of a Boolean value.

The Date data type is an 8-byte values that stores as a decimal numbers. Because Dates are numeric, calculations can use them.

When you specify dates and times in VBA, you enclose them in pound signs instead of the quotation marks used by strings.

Const StartDate As Date = #6/12/2001#

0 0

Post a comment