Camilla has attended:
Excel VBA Intro Intermediate course
Option Explicit
What is the purpose of the "Option Explicit" section at the top of the code editor page?
RE: Option Explicit
Hi Camilla
By default, VBA doesn't require that you declare your variables using the Dim statement.
If the compiler encounters a name that it doesn't recognize as an existing variable, one of the VBA reserved words, or a property or method, it will create a new variable by that name.
While this may seem convenient, spelling mistakes can lead to bugs in the code that are difficult to find.
Using Option Explicit requires that all variables be declared.
The area where the Option Explicit appears is known as the Declarations area and it is where all Module level and public variables are written.
Hope this helps
Carlos