Hi All,
I'm finding it difficult to get the correct syntax for referencing a userform checkbox caption to hide a worksheet. The userform initializes with checkboxes, each one captioned from each sheet name in the workbook. The user checks the sheets they would like to use in the next step of the process and leaves sheets they would like hidden, unchecked. When the command button on the userform is pressed to continue, my code should populate a list on a new sheet called Email Data and hide those sheets that remain unchecked.
The code so far works perfectly except for the part that should hide the unwanted sheets!
My code is this with the problem code highlighted red:
You can see that I am tyring to use the checkbox caption variable as the sheet name so that the worksheet can be hidden in the active workbook but this line errors out no matter what combination I use. I've googled extensively but have not been able to find anything to assist me. Does anyone have an idea what I am doing wrong?
Many thanks!
Bookmarks