Article ID: 191713
Article Last Modified on 6/29/2004
Type Declaration Character Data Type
-------------------------- ---------
<WWBLOCKQUOTE>
% Integer
& Long
! Single
# Double
$ String
@ Currency
Even when using type declaration characters, you still need to declare your
variables when you have Option Explicit at the beginning of the Module.
Using Option Explicit is recommended to prevent problems due to misspelled
variable names. When "Require Variable Declaration" is checked in the
Editor Tab of the Options dialog box from the Tools Menu, Option Explicit
is added to new Modules automatically. If you use Option Explicit, but you
do not declare your variables, you will receive the following error message
at run-time:
To prevent this error from occurring, you can either remove Option Explicit
or explicitly declare your variables. Using type declaration characters
allows you to shorten these statements. For example, you can use this:
Dim MyVar$instead of this:
Dim MyVar As StringBoth statements declare MyVar to be a memory variable of type String.
Additional query words: kbDSupport kbDSD kbVBp kbVBp400 kbVBp500 kbVBp600 kbVBA kbNoKeyWord
Keywords: kbinfo KB191713