VBA – Hide worksheets when not activate

If you are building a worksheet with some VBA in it and you are willing to have only one sheet visible in a time, then you need a small piece of code, hiding all other sheets.


What we should do? Simply a for-each loop which goes through all the sheets and checks their name. If the name is different from the name of the current active sheet, you simply need to hide it.

There it goes:


Tagged with: , ,