Thread: Listbox in form
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JP[_4_] JP[_4_] is offline
external usenet poster
 
Posts: 897
Default Listbox in form

The correct code should be:

Private Sub UserForm_Initialize()
Dim rng As Range, cel As Range
Set rng = ActiveWorkbook.Sheets("clients").Range("b2:b200")
With Me.clients_select_list
.Clear
For Each cel In rng.Cells
.AddItem cel.Value
Next
End With
End Sub

You should review Rick's post -- never try to type out the names of
objects on your form, they are all available from the dropdowns at the
top of the code box.

--JP

On Oct 6, 11:49*am, PA wrote:
Hi thanks for your (very) quick reply!!!

My form is "clients_select" and the list is "clients_select_list"

Thanks-

PA