+ Reply to Thread
Results 1 to 4 of 4

Multiselect Listbox to select multiple worksheets

  1. #1
    Registered User
    Join Date
    12-20-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    2

    Multiselect Listbox to select multiple worksheets

    I have 20 sheets in my worbook. Each time I need to move sheets in between and I need to select multiple sheets to delete.
    I have one ListBox and one command button in Userform. I have already populated active workbook sheet name into ListBox.

    How select multiple sheets using this ListBox1. To select single sheet using this ListBox1. is working ok.

    Is there any macro to select multiple sheets?


    Regards
    Alagu

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: Multiselect Listbox to select multiple worksheets

    Hi Alagu,

    Welcome to the forum!!

    To select multiple items from a listbox follw these four steps:

    1. Open the Visual Basic Editor (Alt + F11) from the workbook where the form resides
    2. Click on the relevant listbox
    3. From the Properties panel scroll down to Multiselect and ensure the 1 - fmMultiSelectMulti option is selected
    4. Assign the following code to the command button to delete the tabs (just change the list box reference to reflect the actual list box name on your form if need be):
    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Registered User
    Join Date
    12-20-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Multiselect Listbox to select multiple worksheets

    Hai Robert,

    Thanks for your Code. It works nicely. I have doubt tt, while selecting multiple sheets using ListBox, sheets names are not highlighted.
    like when we press Ctrl+Select. Only last sheet selected. Is it normal?

    Regards
    Alagu

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: Multiselect Listbox to select multiple worksheets

    If the listbox option is set as per step 3 above, you just need to click each item for it to be selected.

    If the issue persists attach the workbook (devoid of any sensitive data) and I'll have a look for you.

    Robert

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1