View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
davesexcel[_136_] davesexcel[_136_] is offline
external usenet poster
 
Posts: 3
Default Combobox Population

Assuming you know how to create a userform, this would be the code to populate it with items from Column A

'----------------------------------------
Private Sub CommandButton1_Click()

Range("C1") = ComboBox1
Unload Me

End Sub

Private Sub UserForm_Initialize()

Dim Rws As Long, Rng As Range

Rws = Cells(Rows.Count, "A").End(xlUp).Row

Set Rng = Range(Cells(2, 1), Cells(Rws, 1))

ComboBox1.List = Rng.Value

End Sub
'---------------------------------------------

Check this out to learn how to create a UserForm. Insert a combobox instead of a textbox in the example.
http://www.davesexcel.com/createauserform.htm
Here is an example
http://www.davesexcel.com/Populate%2...0userform.xlsm