Built-in Constants

Also known as Intrinsic Constants.
In addition to literal and symbolic constants VBA also has a huge range of built-in constants.
Any built-in constants are examples of symbolic constants and generally start with the characters vb.

VBA.Constants.vbBack 
VBA.Constants.vbCr
VBA.Constants.vbCrLf
VBA.Constants.vbFormFeed
VBA.Constants.vbLf
VBA.Constants.vbNewLine
VBA.Constants.vbNullChar
VBA.Constants.vbNullString
VBA.Constants.vbObjectError
VBA.Constants.vbTab
VBA.Constants.vbVerticalTab

You should try and use the built-in constants rather than the values they represent because the value may change in future versions of VBA.
The constants are also more intuitive and easier to change at a later date, eg vbNewLine = Chr$(13).


Complete List

For a complete list of all the VBA constants refer to the Enumerations > VBA Constants page.


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext