Hi All
I am currently working on a project which uses dependant drop down boxes. Which work all very well, however the issue I am having is that one of the boxes, which is a listbox; needs to be populated with dynamic data from columns C to K , dependant on what's in Combobox1. I have included the code but it is obviously missing the code for getting the data into listbox1.
What I'm really looking for is the correct syntax.
e.g combobox1 shows 'WEST'. Textbox 11,12,13 & 14 populate with data no problem, however listbox1 needs populating from a different sheet called 'SITES' and the data is a list of named ranges, (NORTH, EAST, SOUTH, WEST, etc) so I basically need to know how to get the named range into a 1 column listbox1!
Any help appreciated.
I am currently working on a project which uses dependant drop down boxes. Which work all very well, however the issue I am having is that one of the boxes, which is a listbox; needs to be populated with dynamic data from columns C to K , dependant on what's in Combobox1. I have included the code but it is obviously missing the code for getting the data into listbox1.
What I'm really looking for is the correct syntax.
e.g combobox1 shows 'WEST'. Textbox 11,12,13 & 14 populate with data no problem, however listbox1 needs populating from a different sheet called 'SITES' and the data is a list of named ranges, (NORTH, EAST, SOUTH, WEST, etc) so I basically need to know how to get the named range into a 1 column listbox1!
Any help appreciated.
HTML:
Private Sub ComboBox1_Change()
Dim Look As Range
Set Look = Worksheets("OFFICES").Range("A2:K10").Find(what:=Me.ComboBox1.Value, _
LookIn:=xlValues, _
lookat:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Look Is Nothing Then
MsgBox "No match for " & Me.ComboBox1.Value, , "No Match Found"
Else
Me.TextBox11.Value = Worksheets("OFFICES").Range("B" & Look.Row)
Me.TextBox12.Value = Worksheets("OFFICES ").Range("C" & Look.Row)
Me.TextBox13.Value = Worksheets("OFFICES ").Range("F" & Look.Row)
Me.TextBox14.Value = Worksheets("OFFICES ").Range("H" & Look.Row)
End If
End Sub