List Box Problems - Urgent!!

  • Thread starter Thread starter pcscsr
  • Start date Start date
P

pcscsr

I know I've already posted this but I am desparate at this point. I a
trying to transfer selections I've made in a multi-column list box to
separate worksheet in excel. How can I do this?? I really, really nee
some help!!! thank you :confused
 
pcscsr said:
I know I've already posted this but I am desparate at this point. I am
trying to transfer selections I've made in a multi-column list box to a
separate worksheet in excel. How can I do this?? I really, really need
some help!!! thank you :confused:

Send the sheet pls.
 
Multi column and multi select (you said selections):

Dim rw as Long, i as Long
rw = cells(rows.count,1).End(xlup)(2).Row
With Userform1.Listbox1
for i = 0 to .listcount - 1
if .selected(i) then
rw = rw + 1
Cells(rw,1) = .List(i,0)
Cells(rw,2) = .List(i,1)
cells(rw,3) = .List(i,2)
end if
Next
End With
 
Here is an example

Dim i As Long
Dim j As Long
Dim iRow As Long
iRow = 10
With Me.ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then
For j = 1 To .ColumnCount
ActiveSheet.Cells(iRow, j).Value = .List(i, j - 1)
Next
iRow = iRow + 1
End If
Next i
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top