View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gerry[_5_] Gerry[_5_] is offline
external usenet poster
 
Posts: 1
Default listing items from listbox

I have a listbox, the rowsource is a range on a worksheet.
When this listbox is brought up and names picked, I would like to have these
names entered starting on A4, going downward.
The names are always first and last name, maybe I can extract and copy, but
not sure how to do this.

Any ideas?

TIA
Gerry

Private Sub OKButton_Click()
msg = ""
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then msg = msg & ListBox1.List(i) & vbCrLf
Next i
MsgBox "You selected: " & msg & vbCrLf
Unload Me
With Worksheets("PrintJob").Range("A4")
.Value = msg
.WrapText = True
End With
End Sub