list box help

Aprez76

New Member
Joined
Aug 7, 2008
Messages
23
Looking for some help extracting info from a list box into a worksheet.

Right now I have a user form that has a list box set to multi select with check box style. I would like to extract the record(s) selected by the user to a worksheet... say sheet1, cell a1. Can't figure how to do this with the multiselect.

Any help is much appreciated.

Thanks,

Andrew
 

Some videos you may like

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Scott.C.Lyerly

Board Regular
Joined
May 28, 2009
Messages
70
Try something like this:

Code:
    Dim i As Long
    With Me.ListBox1
        For i = 0 To .ListCount - 1
            If .Selected(i) = True Then
                ActiveSheet.Range("A1").Offset(i, 0).Value = .List(i)
            End If
        Next i
    End With
What you're basically doing is looping through the listbox items and, if they are selected, writing them out to the worksheet.

Modify the listbox name, worksheet, and range as needed.
 

Watch MrExcel Video

Forum statistics

Threads
1,102,291
Messages
5,485,973
Members
407,523
Latest member
Talicius

This Week's Hot Topics

Top