I have the code below to open and close worksheets, but am running into an error and was hoping someone could help. The code works fine when I run it in a blank workbook, but doesn't work when I modify the sheet numbers to the workbook I want to put it into. I'm not real familiar with VBA and wondered if it had something to do with the Pivot Tables in the worksheets or if there is something else wrong.
My code is:
Hide and Unhide Sheets.png
Bookmarks