May 1999
Intermediate to advanced
1440 pages
38h 6m
English
You have either typed Option Explicit in the General Declarations section of your module or you have selected to require variable declarations through the Options dialog box. Because of this you have to use a Dim statement to declare your variables. You tried to use a variable that had not been declared.
The message you see should tell you exactly what you did wrong. It states that it expected a Then or GoTo. You forgot to type Then at the end of the first line of your If statement. This is one of the most common typos in VBA.
Read now
Unlock full access