简体   繁体   中英

Excel vba Hide worksheets

I have serveral worksheets with macro's, some worksheets use other worksheets in the macro. I only want to have 1 worksheet visible and the rest must behidden. If i hide the worksheets the macro's do not run.

What is my mistake?

If the worksheet is hidden and the macro doesn't unhide the sheet first then it won't work. You could add some simple code to cope with it such as:

If sheets("sheet1").visible = false
Then sheets("sheet1").visible = true

This will test to see if it is visible and then unhide it if not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM