Excel .Printout using a variable
Posted on 2011-10-27
I have 2 command buttons, one to print all of the worksheets in a workbook, and another to print the worksheets the user has selected in a multiselect listbox. The Print All code works fine: Worksheets(Array("ActCorpCkReq", "KSI Check req", "NON_VEBA Reti East Ck Req","Retirees VPS")).PrintOut
The second, I am looping through the selected items of the listbox and capturing them in a string separated by commas. So the string might look like "KSI Check req","Retirees VPS"
I want to do something like
Worksheets(Array(strSelected).printout, but I am getting error subscript out of range.