Results 1 to 9 of 9

Select Case

Threaded View

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,177

    Select Case

    I don't see what I am doing wrong in this code using "Select Case". When activated and the correct string is entered I should get a msgbox pop up.
         Dim sLogin As String
        Dim CapsLock As New SetCapsClass
    
        CapsLock.Value = True
        sLogin = InputBox("Enter Employee Number here!")
        If sLogin = "" Then
            MsgBox "You must enter your Employee Number!"
            sLogin = InputBox("Enter Employee Number here!")
            Select Case sLogin
            Case 1
                If sLogin = "RS61" Then
                    MsgBox "User has full READ/WRITE capabilities!"
                    sLogin = True
                End If
            Case 2
                If sLogin = "JE80" Then
                    MsgBox "User has full READ/WRITE capabilities!"
                    sLogin = True
                End If
            Case 3
                If sLogin = "BC58" Then
                    MsgBox "User has full READ/WRITE capabilities!"
                    sLogin = True
                End If
            Case 4
                If sLogin = "BF56" Then
                    MsgBox "User has full READ/WRITE capabilities!"
                    sLogin = True
                End If
            Case 5
                MsgBox "User has WRITE capabilities ONLY!"
                sLogin = False
            End Select
        End If
    Last edited by Rick_Stanich; 10-16-2008 at 10:19 AM.
    Regards

    Rick
    Win10, Office 365

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Select Case Error Handler?
    By hutch@edge.net in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-17-2008, 03:29 PM
  2. Numbers to Text
    By sachinattri in forum Excel General
    Replies: 6
    Last Post: 06-15-2008, 03:07 AM
  3. Coding in visual basic
    By jexy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-06-2007, 08:01 AM
  4. VBA code - color format routine
    By xlwho in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-06-2006, 05:10 AM
  5. type mismatch
    By Mikeyhend in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-16-2006, 01:17 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