+ Reply to Thread
Results 1 to 11 of 11

Store password while the sheet is open

  1. #1
    Forum Contributor murray83's Avatar
    Join Date
    05-05-2016
    Location
    Daventry
    MS-Off Ver
    365
    Posts
    146

    Store password while the sheet is open

    been looking into this and have seen that i need to declare it in module or put it in work sheet load

    my question i would like answering is

    in the example attached when you click on "Amend User Details" it pulls up a userform asking for a password which is at the moment set to "PASSWORD" original i know

    when this is done the database sheet is shown and then when they click back to search it hides but if you need to Amend User Detail again it needs the password

    i would like it so its stored for the life of the workbook being open

    cheers all
    Attached Files Attached Files

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Store password while the sheet is open

    .
    .
    Try this approach...

    Paste this macro into the Sheet Database level module:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Store password while the sheet is open

    Hi

    Pick a cell on a hidden sheet. I used R1 on the Database sheet but probably best if you just add a sheet solely for the PW and NAME it "PASS_Word"

    Then change the Add_Details to

    Please Login or Register  to view this content.
    In the Userform CommandButton1 click event use this code

    Please Login or Register  to view this content.
    And in the Workbook Save Event add a line

    Please Login or Register  to view this content.
    Last edited by Richard Buttrey; 05-22-2017 at 01:21 PM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Contributor murray83's Avatar
    Join Date
    05-05-2016
    Location
    Daventry
    MS-Off Ver
    365
    Posts
    146

    Re: Store password while the sheet is open

    Thats one option cheers

    But would rather have the sheet hidden but when press the button again no need for password

    Richard Buttrey shall check yours out as well

    cheers guys
    Last edited by murray83; 05-22-2017 at 01:24 PM. Reason: when typing Richard Buttrey had already posted reply

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Store password while the sheet is open

    ..in case you missed a late edit I changed #3 - forgot to mention to create the range name

  6. #6
    Forum Contributor murray83's Avatar
    Join Date
    05-05-2016
    Location
    Daventry
    MS-Off Ver
    365
    Posts
    146

    Re: Store password while the sheet is open

    Quote Originally Posted by Richard Buttrey View Post
    Hi

    Pick a cell on a hidden sheet. I used R1 on the Database sheet but probably best if you just add a sheet solely for the PW and NAME it "PASS_Word"

    Then change the Add_Details to

    Please Login or Register  to view this content.
    In the Userform CommandButton1 click event use this code

    Please Login or Register  to view this content.
    And in the Workbook Save Event add a line

    Please Login or Register  to view this content.
    dumb moment me thinks but here goes

    1, How do i make R1 on the database sheet into a range ?

    and

    2, "Workbook Save Event" i dont even have a function like this

  7. #7
    Forum Contributor murray83's Avatar
    Join Date
    05-05-2016
    Location
    Daventry
    MS-Off Ver
    365
    Posts
    146

    Re: Store password while the sheet is open

    ignore the how make a range name

    good ol google

  8. #8
    Forum Contributor murray83's Avatar
    Join Date
    05-05-2016
    Location
    Daventry
    MS-Off Ver
    365
    Posts
    146

    Re: Store password while the sheet is open

    any chance of an example of this uploaded

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Store password while the sheet is open

    See attached,

    The Workbook BeforsSave event is an event in the ThisWorkbook object in the VBA Workbook
    Attached Files Attached Files

  10. #10
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Store password while the sheet is open

    .
    .
    This is the only change I would recommend to the existing I posted :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Forum Contributor murray83's Avatar
    Join Date
    05-05-2016
    Location
    Daventry
    MS-Off Ver
    365
    Posts
    146

    Re: Store password while the sheet is open

    Quote Originally Posted by Richard Buttrey View Post
    See attached,

    The Workbook BeforsSave event is an event in the ThisWorkbook object in the VBA Workbook
    Thank you works a charm just made one slight change rather than just leaving the sheet open now if you click it, it takes you to the sheet

    see attached
    Attached Files Attached Files

+ 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. [SOLVED] EXCEL 2003 - Password to open hidden sheet
    By kevshim in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-19-2013, 12:20 PM
  2. Replies: 3
    Last Post: 09-23-2013, 11:49 PM
  3. [SOLVED] Password to open the sheet
    By emakcali in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-12-2013, 08:53 AM
  4. [SOLVED] Need macro to open excel sheet that is password protected
    By sokker23 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2013, 03:04 PM
  5. Password to open sheet in workbook
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-06-2007, 11:54 AM
  6. How to open a sheet with a password?
    By koda86 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-22-2006, 11:29 AM
  7. [SOLVED] How do I store a macro to run on ever sheet I open?
    By Adam in forum Excel General
    Replies: 1
    Last Post: 02-24-2006, 06:50 AM
  8. [SOLVED] How can one open a protected excel sheet whose password is lost?
    By consultant in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2005, 04:05 AM

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