View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Matt[_38_] Matt[_38_] is offline
external usenet poster
 
Posts: 2
Default Nice easy Listbox queries

Try the following


Private Sub UserForm_Initialize()
Range("Target").ClearContents
Dim ListCell As Range
For Each ListCell In Range("CarList")
ListBox1.AddItem ListCell.Value
Next
End Sub


Private Sub cmdOK_Click()
Dim I As Integer
For I = 1 To ListBox1.ListCount
If ListBox1.Selected(I) = True Then
Range("Target").Cells(I, 1).Formula = ListBox1.List(I)

End If
Next I
Unload Me
End Sub