Combobox Issue
Is it a control toolbox combox?
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Address = "$B$6" Then
Select Case Target.Value
Case "Number 1": Me.ComboBox1.ListFillRange = "C1:C3"
Case "Number 2": Me.ComboBox1.ListFillRange = "D1:D3"
'etc
End Select
End If
ws_exit:
Application.EnableEvents = True
End Sub
'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.
--
HTH
Bob Phillips
"Andy" wrote in message
o.uk...
Hi,
I have a cell value in excel B6
I also have combobox1
What I would like to do is if B6 = "Number 1" then populate the combobox
with the text range C1:C3
If B6 = "Number 2" then populate the combobox with the text range D1:D3
Is this possible, if so can somebody please help???
Thanks for any help
Andy
|