Select Case Not Working

BrianExcel

Well-known Member
Joined
Apr 21, 2010
Messages
975
I am using the following code. Basically, when I select Three from the first list box, the "Three" range should display in the second list box, but nothing happens when I click, regardless of what value....thoughts?

Code:
Sub lbxFloor_Click()
Dim sText As String

    For x = 0 To UserForm1.lbxFloor.ListCount - 1
        If UserForm1.lbxFloor.Selected(x) Then
            sText = UserForm1.lbxFloor.Value
        End If
    Next x

    With Sheets("Printer Data")
        UserForm1.lbxPrinterList.Clear
        Select Case sText
            Case Three
                UserForm1.lbxPrinterList.RowSource = "rThree"
            Case Six
                UserForm1.lbxPrinterList.RowSource = "rSix"
            Case Fifteen
                UserForm1.lbxPrinterList.RowSource = "rFifteen"
        End Select
    End With
End Sub
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
should it be
Code:
Case [COLOR=Red][B]"[/B][/COLOR]Three[B][COLOR=Red]"[/COLOR][/B]
  UserForm1.lbxPrinterList.RowSource = "rThree"
Case [B][COLOR=Red]"[/COLOR][/B]Six[COLOR=Red][B]"[/B][/COLOR]
   UserForm1.lbxPrinterList.RowSource = "rSix"
Case [B][COLOR=Red]"[/COLOR][/B]Fifteen[B][COLOR=Red]"[/COLOR][/B]
 
Upvote 0

Forum statistics

Threads
1,224,531
Messages
6,179,379
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top