muilti-select listbox choices back into worksheet

Chris Davison

MrExcel MVP
Joined
Feb 15, 2002
Messages
1,790
how do I get, say, 10 choices made on a multi-choice 4-column listbox from a userform back onto a worksheet - say cells A1:D10 ?

thanks
Chris
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Example:

Code:
Private Sub CommandButton1_Click()
    Dim i As Integer
    Dim r As Integer
    r = 0
    Worksheets("Sheet1").Cells(1, 1).Resize(65536, 4).ClearContents
    With ListBox1
        For i = 0 To .ListCount - 1
            If .Selected(i) Then
                r = r + 1
                Worksheets("Sheet1").Cells(r, 1).Value = .Column(0, i)
                Worksheets("Sheet1").Cells(r, 2).Value = .Column(1, i)
                Worksheets("Sheet1").Cells(r, 3).Value = .Column(2, i)
                Worksheets("Sheet1").Cells(r, 4).Value = .Column(3, i)
            End If
        Next i
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,196,206
Messages
6,014,011
Members
441,802
Latest member
Aneurysm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top