+ Reply to Thread
Results 1 to 8 of 8

password for command button

  1. #1
    Forum Contributor
    Join Date
    08-24-2011
    Location
    Van Wert, Ohio
    MS-Off Ver
    Excel 2010, 2000
    Posts
    104

    password for command button

    I have two command buttons

    One that protects multiple sheets within a workbook at the same time

    The other button "unprotects" all the sheets.

    Is there a way to require a password when the unprotect button is pressed?

    I am working with excel 2000.

    Thanks in advance

  2. #2
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    883

    Re: password for command button

    Try something like....
    In the CommandButton code
    Please Login or Register  to view this content.
    In a standard module
    Please Login or Register  to view this content.
    If my solution worked (or not) please let me know. If your question is answered then please remember to mark it solved

    Computers are like air conditioners. They work fine until you start opening windows. ~Author Unknown

  3. #3
    Forum Contributor
    Join Date
    08-24-2011
    Location
    Van Wert, Ohio
    MS-Off Ver
    Excel 2010, 2000
    Posts
    104

    Re: password for command button

    WasWodge, thanks for you input. How would I incorporte your code into my code to cover all the sheets

    Thank You




    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    883

    Re: password for command button

    Sorry my fault for not reading the question properly. Replace all the code with...

    In the CommandButton code
    Please Login or Register  to view this content.
    In a standard module
    Please Login or Register  to view this content.
    EDIT: or actually you can just put it all in the command button code
    Please Login or Register  to view this content.
    Last edited by WasWodge; 06-15-2013 at 05:31 PM.

  5. #5
    Forum Contributor
    Join Date
    08-24-2011
    Location
    Van Wert, Ohio
    MS-Off Ver
    Excel 2010, 2000
    Posts
    104

    Re: password for command button

    Thanks WasWodge

    Got an error msg

    Compile Error
    Sub or Function Defined

    It takes me to debugger and highlights

    Please Login or Register  to view this content.
    Private Sub CommandButton2_Click() - this highligts in yellow



    Thanks for you help

  6. #6
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    883

    Re: password for command button

    Obviously too much beer today
    Please Login or Register  to view this content.

  7. #7
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: password for command button

    Perhaps
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  8. #8
    Forum Contributor
    Join Date
    08-24-2011
    Location
    Van Wert, Ohio
    MS-Off Ver
    Excel 2010, 2000
    Posts
    104

    Re: password for command button

    Got it

    Enjoy your beer thanks for your help

+ 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.6.0 RC 1