• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Option Explicit automatically inserted - can it be "expanded?"

Dr. Demento

Member
I realize that under Options I can turn on Require Variable Declaration, which automatically inserts "Option Explicit" into new modules. I'm curious if there's way to automatically add other flags (see here) in the same manner (open a new module and all the flags to turn off/on all non-essential functions are already listed)?

Thanks, y'all!
 
Why not simply setup a set of code in a code module
Then save it by right clicking on the Code Module Tab and then Export File
That allows you to save the code as a *.BAS file

You can then import that every time you want your code
Right click on a code module Import File
 
You could modify the code in the file attached by "Speedy" above to add a few more lines if required.
 
Sweet! Thanks, gents!

I think I understand how/where to insert the code to turn off the non-essential functions. What I'm not sure of is how to turn them back on before exiting the sub.
 
If you have a function at the start of the Sub like
Application.screenupdating=False

You will need to have a similar function
Application.screenupdating=True
before the end

same for other functions
 
I'm sorry - I wasn't very clear o_O. My confusion comes from how/where to insert code for the workbook that Speedy provided.

I like your solution for going forward but I like Chip's solution for updating past projects.

Thanks so much.
 
Back
Top