Keywords
Keywords are special words that are reserved.
These keywords are used by the compiler to determine the structure of your code.
These are displayed in Blue by default in the Code window.
These cannot be used for variables, or subroutine or function names.
#If | (Advanced) Used with conditional compilation arguments. |
#Else | (Advanced) Used with conditional compilation arguments. |
#Else If | (Advanced) Used with conditional compilation arguments. |
#End If | (Advanced) Used with conditional compilation arguments. |
#Const | (Advanced) Used with conditional compilation arguments. |
Alias | (Advanced) Used when declaring an external procedure in a DLL that has the same name and something else. |
And | (Operator) Used as the logical 'AND' operator. |
As | Used when defining the data type of a variable or argument. |
Base | Used when changing the default lower bound of an array, Option Base 1. |
Boolean | (Data Type) Used to hold either the value True or False. |
Byte | (Data Type) Used to hold any positive number between 0 and 255. |
ByRef | Used to pass variables in and out of subroutines and functions. |
ByVal | Used to pass variables into subroutines and functions. |
Call | Used to allow arguments to be passed in parentheses when execution moves inside a subroutine or function. |
Case | Used with the Select keyword when using conditional branching. |
CBool | (Data Type Conversion) Used to convert an expression to a Boolean. |
CByte | (Data Type Conversion) Used to convert an expression to a Byte. |
CCur | (Data Type Conversion) Used to convert an expression to a Currency. |
CDate | (Data Type Conversion) Used to convert an expression to a Date. |
CDbl | (Data Type Conversion) Used to convert an expression to a Double. |
CInt | (Data Type Conversion) Used to convert an expression to an Integer. |
CLng | (Data Type Conversion) Used to convert an expression to a Long. |
CLngLng | (Data Type Conversion) Used to convert an expression to a LongLong. |
CLngPtr | (Data Type Conversion) Used to convert an expression to a LongPtr. |
Compare | (Advanced) Used to change the string comparison settings, Option Compare Binary. |
Const | Used to define symbolic constants. |
CSng | (Data Type Conversion) Used to convert an expression to a Single. |
CStr | (Data Type Conversion) Used to convert an expression to a String. |
Currency | (Data Type) Used to hold numbers when you do not want any rounding errors. |
CVar | (Data Type Conversion) Used to convert an expression to a Variant. |
Database | (Advanced) Used to change the string comparison settings, Option Compare Database. |
Date | Used to define the current system date. |
Declare | (Advanced) Used when calling windows API functionality. |
DefBool | (Advanced) Used to define certain variables to have a Boolean data type. |
DefByte | (Advanced) Used to define certain variables to have a Byte data type. |
DefDate | (Advanced) Used to define certain variables to have a Date data type. |
DefDec | (Advanced) Used to define certain variables to have a Variant/Decimal data type. |
DefDouble | (Advanced) Used to define certain variables to have a Double data type. |
DefInt | (Advanced) Used to define certain variables to have a Integer data type. |
DefLng | (Advanced) Used to define certain variables to have a Long data type. |
DefLngLng | (Added in Office 2010) Used to define certain variables to have a LongLong data type. |
DefLngPtr | (Added in Office 2010) Used to define certain variables to have a LongPtr data type. |
DefObj | (Advanced) Used to define certain variables to have a Object data type. |
DefSng | (Advanced) Used to define certain variables to have a Single data type. |
DefStr | (Advanced) Used to define certain variables to have a String data type. |
Dim | Used when declaring one or more variables. |
Do | Used with the Until or Loop keywords when repeating one or more statements. |
Double | (Data Type) Used to hold double precision floating point numbers. |
Each | Used with the For keyword to access the individual elements in a collection. |
Else | Used with the If keyword when using conditional branching. |
ElseIf | Used with the If keyword when using conditional branching. |
Empty | Used with a Variant data type when a value has not been assigned. |
End | Used to terminate a subroutine, function or property. |
Enum | Used to define a user defined enumeration. |
Erase | (Advanced) Used to reinitialize the elements in an array. |
Error | (Statement) Used to generate an error message. |
Event | (Statement) Used to declare a user defined event. |
Exit | Used to exit a subroutine or function early before it reaches the end. |
Explicit | Used to force variables to be declared before they can be used, Option Explicit. |
False | Used to represent the value 0. |
For | Used with the Next keyword when repeating one or more statement. |
Friend | (Advanced) Used in class modules to prevent subroutines from being accessed from external projects. |
Function | Used to declare a block of code that can return a value. |
Get | (Advanced) Used with the Property keyword when creating objects. |
Global | Can be used to declare a Public variable that is visible from all the code modules. |
GoTo | Used to jump to a line label or reset error handling. |
If | Used with the Then keyword to allow conditional branching. |
IIf | (Advanced, Function) Used to return one of two values based on the value of an expression. |
Implements | (Advanced) Used with the Class keyword when creating objects. |
Integer | Used to hold any whole number between -32,768 and 32,767. |
Is | Compares two object reference variables. |
Let | (Advanced) Used with the Property keyword when creating objects. |
LBound | (Advanced, Function) Used to return the lower limit of an array dimension. |
Lib | (Advanced) Used when calling windows API functionality. |
Like | Used to compare two strings and provide pattern matching. |
Long | (Data Type) Used to hold any whole number between -2,147,483,648 and 2,147,486,647. |
LongLong | (Advanced, Data Type) Used to hold large whole numbers on a 64 bit system. |
Loop | Used with the Do keyword when repeating one or more statements. |
LSet | (Advanced, Statement) Used to left align a string within a string variable. |
Me | (Advanced) Used as an implicitly declared variable inside a class module or userform. |
Mod | (Operator) Used to divide two numbers and return the remainder. |
New | (Advanced) Used to create a new instance of an object. |
Next | Used with the For keyword when repeating one or more statements. |
Not | (Operator) Used as the logical 'NOT' operator. |
Nothing | Used as the default value when an object has not been initialised. |
Null | (Advanced, Variant) Used to explicitly indicate an invalid value or error. |
Object | (Data Type) Used to contain a reference (or address) to an actual object. |
On | Used with the Error keyword when using error handling. |
Option | Used to define module level settings. |
Optional | Used to indicate that a variable passed to a subroutine or function is optional. |
Or | (Operator) Used an the logical 'OR' operator. |
ParamArray | (Advanced) Used to allow a dynamic number of arguments to be passed to a subroutine or function. |
Preserve | (Advanced) Used to preserve the items in an array when it is being resized. |
Private | Used to declare a subroutine that is only visible in that code module. |
Property | (Advanced) Used with the Class keyword when creating objects. |
Public | Used to declare a subroutine that is visible from all the code modules. |
RaiseEvent | (Advanced) Used to trigger a class module user defined event. |
ReDim | (Advanced, Function) Used to initialise or resize an array. |
Resume | (Advanced) Used with the On Error keywords when using error handling. |
Return | (Advanced) Used with the GoSub keyword to return execution back to the original line. |
RSet | (Advanced, Statement) Used to right align a string within a string variable. |
Select | Used with the Case keyword in conjunction with conditional branching. |
Set | (Advanced) Used with the Property keyword when creating objects. |
Single | (Data Type) Used to hold single precision floating point numbers. |
Static | (Advanced, Variables) Used to indicate that a variable will be preserved between calls. |
Step | Used with the For keyword to provide additional increments and decrements. |
Stop | (Advanced) Used to allow you to save a breakpoint in your file. |
String | (Data Type) Used to hold string variables that are fixed length or variable length. |
Sub | Used to declare a block of code that does not return a value. |
Text | Used to change the string comparison settings, Option Compare Text. |
Then | Used with the If keyword in conjunction with conditional branching. |
To | Used with the For keyword when repeating one or more statements or when declaring a fixed size aaray. |
True | Used to represent the value -1. |
Type | (Advanced) Used to define a user defined data structure. |
TypeOf | (Operator) Used to return the data type of an object. |
UBound | (Advanced, Function) Used to return the upper limit of an array dimension. |
Until | Used with the Do keyword when repeating one or more statements. |
Variant | (Data Type) Used to hold any type of data except fixed-length strings and user defined types. |
Wend | Used with the While keyword when repeating one or more statements. |
While | Used with the Do keyword when repeating one or more statements. |
With | (Advanced) Used to perform multiple operations on a single object. |
WithEvents | (Advanced) Used in class modules to define a variable that can receive events. |
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrev