+ Reply to Thread
Results 1 to 3 of 3

Login feature, help on adapting it for multiple users

  1. #1
    Forum Contributor
    Join Date
    09-04-2006
    Location
    Yorkshire, England
    Posts
    267

    Login feature, help on adapting it for multiple users

    Hi All

    Can anyone help me? I have gone brain dead. What i am trying to achieve is a user security login feature that alows certain access to certian people.
    At the moment the access levels assigned changes the colour of a cell (as i will add more code later). But what i am really stuck on is adapting it for multiple users, ie me (James) and Lara. I just cannot remeber the Vba to do it.

    Heres the code so far:

    Sub workbook_open()
    UserName = InputBox("Please Enter Your Login ID", "Login In")
    If UserName <> "Lara" Then GoTo Wrongname
    Range("B4").Select
    With Selection.Interior
    .ColorIndex = 6
    .Pattern = xlSolid
    End With
    Range("B6").Select
    Exit Sub
    Wrongname:
    MsgBox "You can only access this document as view only"
    Range("B4").Select
    Selection.Interior.ColorIndex = 3
    Range("B6").Select
    Exit Sub
    End Sub


    Any help will be much appriciated

    Thanks
    JR
    Versions
    Mac OS X 'Leopard'
    Mac MS Office Excel 2004
    Windows XP
    MS Excel 2002
    MS Excel 2003

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394
    try using select case


    ie Select Case myUserName
    Case is "Jenny"

    With Selection.Interior
    .ColorIndex = 6
    .Pattern = xlSolid
    End With

    case is "Johnny"

    With Selection.Interior
    .ColorIndex = 7
    .Pattern = xlSolid
    End With

    case else

    MsgBox "You can only access this document as view only"
    Range("B4").Select
    Selection.Interior.ColorIndex = 3
    Range("B6").Select

    end select

  3. #3
    Forum Contributor
    Join Date
    09-04-2006
    Location
    Yorkshire, England
    Posts
    267
    Thanks very much Mallycat

+ 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