• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel 2010 - Subscript out of range error

Nu2Java

Member
I have attached a file I am working with that has a userform with a listbox and two buttons. One piece of code loads the listbox with all sheet names. Transfer to master button puts each selected listbox item in a list on the sheet. Then I use another piece of code to combine the list of sheets that are listed on the master but I get a "subscript out of range" error and cannot figure out why. Thanks for any help
 

Attachments

  • Setup-Sheet - Copy.xlsm
    41.7 KB · Views: 7
Hi ,

Please mention the line of code which generates the error you have mentioned.

What should we do so that we can reproduce the error at our end ?

Narayan
 
I finally figured it out. The error was in the line below which was adding a tab to my line, so the match was not found from the sheet name.
Code:
strMsg = strMsg & ListBox1.List(lngIndex, 0) & ListBox1.List(lngIndex, 1)
 
Back
Top