Thread: Combo box
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_1315_] Rick Rothstein \(MVP - VB\)[_1315_] is offline
external usenet poster
 
Posts: 1
Default Combo box

If you are really looking for VBA code, give this a try...

Sub FillComboBox()
Dim X As Long
ComboBox1.Clear
For X = 2 To ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
ComboBox1.AddItem Replace(Cells(X, "B").Value & " " & _
Cells(X, "C").Value & " " & _
Cells(X, "A").Value, " ", " ")
Next
End Sub

The code assumes your names start in Row 2 (with Row 1 being the header row)
and will fill down to the last name (using Column A).

Rick


"Rick" wrote in message
...
I have a Accounts sheet that contains the following:
Col-A = Last Name
Col-B = First Name
Col-C = M.I.

I want to load a combo_box on the Invoice sheet with data from all 3
columns
and up to 10 rows.

Can you help me with the code.