View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Greg B[_18_] Greg B[_18_] is offline
external usenet poster
 
Posts: 5
Default Combobox Population

Thank you for the answers.
Greg
"davesexcel" wrote in message
news:8064778.146.1332458365000.JavaMail.geo-discussion-forums@pbctp7...
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