Thread: listbox code
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jennifer Jennifer is offline
external usenet poster
 
Posts: 385
Default listbox code

Hello all,
I found this code in the archives and it gets me going in the right
direction, but i am going to need further direction.
I have a userform with a multi select listbox i would like the selections to
be pasted to a worksheet ("GwrStmts").
So far the code only paste one column of the info and not all 3 that are in
the list box and i need it to paste the info in area "b20:d50" (this is my
selected print area)

Thank you in advance. Gracias!

Private Sub cmbSubmit_Click()
Dim i As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
For i = 0 To Me.lstData.ListCount - 1
If Me.lstData.Selected(i) Then
ws.Range("Anchor").End(xlUp).Offset(1, 0) _
..Value = Me.lstData.List(i)
End If
Next i
End Sub

--
Though daily learning, I LOVE EXCEL!
Jennifer