Combo Boxes

  • I want to create a form and use VBA to make a combo box list all the sheets in a book. Is it possible to select multiple entries like in HTML? I would like the user to be able to select the sheets they do not want to delete before a macro runs. Thanks

  • Re: Combo Boxes


    hi Z,


    first of all i don't think you can multiselect a combobox,
    you can achieve that with a listbox


    in VBE, place a listbox on a userform and set it in the Properties > Multiselect >
    1-MulltiSelectMulti


    double click the userform and place this module:

    Code
    Private Sub UserForm_Initialize()
    Dim ws As Worksheet
    For Each ws In ThisWorkbook.Worksheets
        With Me.ListBox1
            .AddItem ws.Name
        End With
    Next
    End Sub


    hope this helps

    Cheers
    ___________
    Xlite :sheep:
    [st]All you need to learn VBA is an internet connection and Ozgrid.com[/st]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!