+ Reply to Thread
Results 1 to 3 of 3

Macro to Prompt for Password and Unprotect Sheet

  1. #1
    Registered User
    Join Date
    07-18-2014
    Location
    Lexington, KY
    MS-Off Ver
    2007
    Posts
    29

    Macro to Prompt for Password and Unprotect Sheet

    I use the following on a button to hide columns of sensitive information and protect the sheet so the form can be e-mailed with a level of privacy.
    Please Login or Register  to view this content.
    I have a second button with the following code that unprotects it and unhides the columns.

    Please Login or Register  to view this content.
    This, of course, is not secure at all. I would like a box to pop up and prompt me for the password before it executes the other functions.

    If there is a better way to do all of this I am always learning and would love to hear it!

    Thanks in advance.
    Last edited by alansidman; 05-08-2016 at 02:18 PM.

  2. #2
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: Macro to Prompt for Password and Unprotect Sheet

    Hi,

    You could use an inputbox to prompt the user.

    Please Login or Register  to view this content.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Macro to Prompt for Password and Unprotect Sheet

    @slindfors

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    ( I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Unprotect a sheet that has password protection
    By cobwebs in forum Excel General
    Replies: 1
    Last Post: 01-25-2016, 04:49 PM
  2. How to Prompt for Sheet Unprotect Password using a Macro
    By cvishu in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-18-2014, 05:34 AM
  3. Unprotect sheet and re-protect with new password
    By nwb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2014, 04:47 AM
  4. ActiveWorkbook.Unprotect (prompt for password)
    By jamesryan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2008, 04:54 AM
  5. Lost password for unprotect sheet
    By riquest in forum Excel General
    Replies: 2
    Last Post: 03-16-2007, 06:28 AM
  6. code to unprotect sheet with password
    By BorisS in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-21-2006, 09:30 PM

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