+ Reply to Thread
Results 1 to 3 of 3

Check list of names against application username for authorisation

  1. #1
    Registered User
    Join Date
    05-16-2011
    Location
    Milton Keynes
    MS-Off Ver
    Excel 2007
    Posts
    29

    Check list of names against application username for authorisation

    Hi everyone

    I have a list of users in sheet "USERS" that when I select a command button to open a userform it will look down the list and check the names against the application username. If the name matches then the form will open and if there is no match then a message box to say why you cant open the userform. The list of users needs to be open and I need to be able to maintain the list.

    I can get it to work for a username in a single range but not read down a list. Suggestions welcome

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

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,423

    Re: Check list of names against application username for authorisation

    Use the range's Find method to find a value in a range. The range can be set manually for a named range, a dynamic named range, or the vba dynamic range method that I used.

    Please Login or Register  to view this content.
    Obviously, one would want to hide the USERS sheet.

    A better method is to use Environ("username") as Application.Name can be changed easily.

  3. #3
    Registered User
    Join Date
    05-16-2011
    Location
    Milton Keynes
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Check list of names against application username for authorisation

    Hi Kenneth

    Thanks for the response it is exactly what I was trying to achieve. Yes you are correct the "USER" sheet will be hidden.

    Thanks miff3436

+ 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] VBA code to change the application.username and application.userinitials
    By jwlamb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2014, 11:25 PM
  2. Replies: 1
    Last Post: 11-27-2008, 11:11 AM
  3. Application UserName
    By talytech in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-24-2007, 05:06 PM
  4. Can I check names in one list agains names in another in excel?
    By John@Hospice of Hope in forum Excel General
    Replies: 1
    Last Post: 08-22-2006, 04:30 AM
  5. check if in list else quit application
    By Pierre via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2005, 03:35 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