K
KimberlyC
Hi
I'm using the following code to copy the contents of a listbox (user selects
the listed items to be copied) in a user form to a range in a worksheet:
(The listbox is populated from data in a worksheet)
Private Sub CommandButton1_Click()
Dim i As Integer
Dim j As Integer
With listbox1
For i = 0 To .ListCount - 1
If .Selected(i) Then
Range("codestosummary").Offset(j, 0).Value = .List(i)
j = j + 1
End If
Next i
End With
Unload CodesToSummaryForm
End Sub
When I run this code.. I would like to have the contents copied to the
first cell empty in Col. B ..starting with cell B14... all the way down to
B49..
So.. if the user selects 3 items to be copied in the listbox... and cells
B14 through B20 have data in them... then those listbox items would be
pasted into cell B21, B22, and B23.
I do not know how to do this...
Any help would be greatly appreciated..
Thanks in advance..
Kimberly
I'm using the following code to copy the contents of a listbox (user selects
the listed items to be copied) in a user form to a range in a worksheet:
(The listbox is populated from data in a worksheet)
Private Sub CommandButton1_Click()
Dim i As Integer
Dim j As Integer
With listbox1
For i = 0 To .ListCount - 1
If .Selected(i) Then
Range("codestosummary").Offset(j, 0).Value = .List(i)
j = j + 1
End If
Next i
End With
Unload CodesToSummaryForm
End Sub
When I run this code.. I would like to have the contents copied to the
first cell empty in Col. B ..starting with cell B14... all the way down to
B49..
So.. if the user selects 3 items to be copied in the listbox... and cells
B14 through B20 have data in them... then those listbox items would be
pasted into cell B21, B22, and B23.
I do not know how to do this...
Any help would be greatly appreciated..
Thanks in advance..
Kimberly