+ Reply to Thread
Results 1 to 4 of 4

Thread: Master password for multiple macros

  1. #1
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2010
    Posts
    132

    Master password for multiple macros

    Hello People
    I have a "program" if that's what you'd call it that has 7 worksheets. 3 are visible, 2 are very hidden helpers & 2 appear when & if a macro is run & disappear when it ends. It also has 14 userforms, some with macros, some not & 18 modules.
    I use the same password for all the worksheets & a different one for macro protection.
    Is there a way to set up a master password for all the sheets? As it is now if I wanted to change the password I would have to go through each macro to change them. Is there a way to use or adapt the code below? Or would it be something completely different?
    The whole thing is working as I want it to. I'm looking to improve maintenance efficiency.
    Thanks

    Private Sub DeleteShort()
       Dim Scr As Long
       Const strPassword     As String = "IdHav2KillU"
       ActiveSheet.UnProtect Password:=strPassword
       Activesheet.Protect Password:=srtPassword
    End Sub

  2. #2
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,777

    Re: Master password for multiple macros

    At the top of any standard module (not a Forms module, not a sheet module, not the ThisWorkbook module)

    Public Const strPassword As String = "IdHav2KillU"
    Then remove the declaration from all the procedures.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Master password for multiple macros

    Thank you shg. That was easy. I now have only one module & one place to change the password for the lot, including userforms. Made life a lot easier
    Cheers

  4. #4
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,777

    Re: Master password for multiple macros

    You're welcome, good luck.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0