You can understand the use of Option Explicit statement in the VBA code by clicking here. Now, here you'll see that how you can instruct the Excel VBA to automatically add Option Explicit statement in your VBA code. To do so please follow the following steps:
- Go to the Visual Basic Editor. then,
- Click on the Tools menu and then,
- Click on the Options, It will open the Options Wizard as shown in the below screenshot
- Check Require Variable Declaration option available under Editor Tab of the Options Wizard window, then
- Click on the OK button.
There you go! Now, whenever you start the Visual Basic Editor in the excel and insert a new Module. You will see that Option Explicit statement is already written in the code window.
No comments:
Post a Comment