Basically, you can't do that exactly as you want. You can declare Height
as Boolean, and then have constants TALL and SHORT equal to TRUE and
FALSE. E.g.,
Dim bHeight As Boolean
Const TALL = True
Const SHORT = False
Another way is to use an Enum variable type, which is really a Long type.
The enum must be declared before and outside of any Sub or Function
procedure.
Enum Height
TALL = True
SHORT = False
End Enum
Then, declare a variable of this type.
Dim H As Height
and give it a value.
H = TALL
' Or
H = SHORT
Note that declaring a variable as an enum type does NOT prevent any other
value from being assigned to that variable. For example, it is perfectly
legal to assign any valid Long value to the H variable, even if that value
is neither TALL or SHORT.
--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)