Reference Combo Box to Column of Data

  • Thread starter Thread starter Benjamin
  • Start date Start date
B

Benjamin

Question: How do I reference a list of data from a column in a combo box

I have a drop down menu in a Form, I figure use a combo box
I'd like to have it reference a specific name range in a sheet or Column for
instance.
I'll have apples, pears, peaches, etc in Column B
So if a user changes column B then the combo box will reflect that change
when it's opened.
 
You can use the Userform_initialize event to populate the values into that
combobox.

One way is:

Option Explicit
Private Sub UserForm_Initialize()
With Worksheets("Sheet1")
Me.ComboBox1.List _
= .Range("b1", .Cells(.Rows.Count, "B").End(xlUp)).Value
End With
End Sub

But there are lots of other ways, too. They can be useful if want to format the
values in the combobox (money/time/dates) or want to skip cells that don't meet
a certain criteria.
 
Back
Top