+ Reply to Thread
Results 1 to 3 of 3

Can I use global variable to change password and username?

  1. #1
    Forum Contributor
    Join Date
    11-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    190

    Can I use global variable to change password and username?

    I have a login form and employee table.
    In this employee table, I saved name and password.
    If they enter correct name and password, they can open 4 sheets by their password to view and edit.
    I used below cord on the top of the module.

    Public userPass as string
    Public username as String

    To edit sheets, they click 'Unprotect' on the Ribbon, then enter their password to unprotect sheets.
    How can I change password for sheets, so employees can see sheets?
    OR, is this possible in the Excel?
    Thanks.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,926

    Re: Can I use global variable to change password and username?

    If I am reading this correctly you want that if a person provides the correct personal credentials, they can unprotect the sheet.

    The sheets themselves will have "fixed" passwords for opening. What you can do in the module that checks the person's credentials is set a global variable to TRUE.
    Please Login or Register  to view this content.
    Then give the person a button or CTRL key to run a macro to unprotect the sheet. In the code to unprotect the sheet using the sheet's password
    Please Login or Register  to view this content.
    Last edited by dflak; 12-06-2016 at 01:45 PM.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Contributor
    Join Date
    11-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    190

    Re: Can I use global variable to change password and username?

    Thanks, I got it.

+ 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. username & password
    By rana19 in forum Excel General
    Replies: 2
    Last Post: 11-01-2014, 09:48 AM
  2. [SOLVED] Username and Password VBA with the ability for user to change the password
    By egemencoskun in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-24-2014, 05:02 AM
  3. Username and Password Form
    By parekdhr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2014, 06:48 PM
  4. [SOLVED] Username and Password Form - Show Username in Sheet
    By ryan180 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2013, 07:06 PM
  5. [SOLVED] Global variable declared in Userform. Variable value is not sticking
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-25-2012, 08:50 AM
  6. Username and password
    By mitelkm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-28-2007, 12:27 PM
  7. username/password
    By nicmarty in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2007, 06:58 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