Select/Deselect sheet tabs using Ctrl


Posted by Eugene Robinson on December 24, 2001 12:56 AM

I have a workbook with 52 sheets, updated daily. Not all 52 sheets will be required, average of 38 each day. A macro runs and pauses for user input. Here I always select the second sheet and then what other sheets require editing that day. Using Ctrl whilst selecting, blocks all sheets selected. The macro resumes, prints out the sheets blocked, saves and closes the workbook. The next day I open the workbook and the selected sheets still show blocked. I now deselect sheet2 and select sheet 1, retaining the other blocked sheets. Another Macro starts, changes the layout saves and prints. I do this procedure manually thus:
Depress Alt and select the first sheet, release the Alt key and select the first sheet again to make it the active one. Depress Alt and select the second tab, sheet deactivates, the other previously selected sheets remain blocked. Can I automate this bit in the macro ?



Posted by Damon Ostrander on December 25, 2001 11:28 PM

Hi Eugene,

I would think it would be a lot easier, at least for the user (in this case, you) if you set it up so that whenever your macro runs it pops up a userform with a multiselect dropdown list of all the sheets so that you can just un-check the ones you don't want included this time and check the ones you do. As you check/un-check items, you could have the code select/un-select the sheets. I'd be happy to post or email you an example if you're interested.

Damon