Hi,
I am trying to understand the best way to deal with passwords in VBA. I have a spreadsheet with multiple sheets that each have the same password. When I run various macros on each sheet it takes off the password and then puts it back on. Currently, however, the password is hard coded into the macro so each time I literally write the password. If the password were to then change for some reason it would mean having to replace all instances of the password throughout the code.
I believe you can declare the password as a global of some kind (if that it the right terminology - apologies I am still very new to VBA) so that you only have to change it in one place.
1. How do you set a password as a "global" for all macros in a project
2. What code do you then use in each macro to refer to this global?
Thanks
MissDB
Bookmarks