Populate Listbox with named range

Status
Not open for further replies.

MavicPro

New Member
Joined
Dec 17, 2018
Messages
3
I currently have a userform which the user choses a selection from the Combobox and the other textboxes populate data dependant on what was chosen, this all goes well however I am unable to get the listbox populated. The listbox data (named ranges) are on a different sheet called SITES (Column C is a named range, As is Column D all the way through to column K)


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

What needs adding is something like

Me.Listbox1 = Value=Worksheets(“SITES”).range (“NAMED RANGE)

However I am struggling with the correct syntax, obviously Listbox1 is dependant on what is chosen in Combobox1, So if NORTH is chosen Listbox1 will show the named range called ‘NORTH’ etc.

It is only a one column listbox (for now!) but will probably expand as the data gets bigger.

Any help appreciated
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Duplicate https://www.mrexcel.com/forum/excel-questions/1081045-populate-listbox.html

Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread.
Per forum rules, posts of a duplicate nature will be locked or deleted (rule 12 here: Forum Rules).

Note that sometimes posts from new users require Moderator approval before you can see them on the public forums. When this happens, you should see a message to that effect when you try to post it.
Please be patient and do not attempt to post the question again.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,223,896
Messages
6,175,260
Members
452,627
Latest member
KitkatToby

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