ComboBox & Worksheet_Change

Vytfla

New Member
Joined
Apr 26, 2011
Messages
11
I'm trying to make a combobox with a few names; when the user chooses any of the names, designated cells will display info corresponding to the appropriate names. Here is my workbook

Code:
Private Sub Worksheet_Change(ByVal Sh As Object, ByVal Target As Range)
    If Target.Address = ("$L$32") Then
        Select Case Target.Text
            Case "John"
                Range("L34").Value = "02081252121"
                Range("L35").Value = "SR5 6HY"
            Case "Frank"
                Range("L34").Value = "07854565252"
                Range("L35").Value = "HA5 6TY"
            Case "Jamie"
                Range("L34").Value = "03263659898"
                Range("L35").Value = "NW5 6YT"
        End Select
    End If
End Sub

It's not working, and I'm not sure why. For cell L32, I created the combobox by going to the Data tab>data validation, then under the Settings tab changing the critera to 'List', then manually entering all the names I want in the source box.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
When I changed the Sub declaration line to this it worked.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
 
Upvote 0

Forum statistics

Threads
1,224,543
Messages
6,179,429
Members
452,914
Latest member
echoix

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