AD_Taylor
Well-known Member
- Joined
- May 19, 2011
- Messages
- 687
I know that if you add Option Explicit to the top of a code module, you have to explicitly declare all variables used (which really helps me as I misspell variables a lot)
However if I do misspell one further on down, what happens?
Assuming I have 'On Error Resume Next' activated I won't see the error, so I'll just get very strange results from running the code?
Is there a check I can do, to make sure that all variable definitions are declared?
I.e. Check through a code module and if for example:
undeclaredVar = Cells(1, 1).Value
an undeclared variable is found it would highlight it?
However if I do misspell one further on down, what happens?
Assuming I have 'On Error Resume Next' activated I won't see the error, so I'll just get very strange results from running the code?
Is there a check I can do, to make sure that all variable definitions are declared?
I.e. Check through a code module and if for example:
undeclaredVar = Cells(1, 1).Value
an undeclared variable is found it would highlight it?