How To Automatically Hide Sheet in Microsoft Excel 2010

In this article, you will learn how to hide sheet automatically when the sheet is not in use.

 

Let us understand with an example:

Consider you are working on multiple worksheets (like Sales Report, Months, Raw Data, etc.) here you only need to unhide few (or single sheet) sheets when you are not using them.

Following is a snapshot of Sales Report; the workbook contains monthly data in each tab like Jan, Feb & so on.
 
img1
 
The below snapshot shows the number of sheets this workbook contains
 
img2
 
If you are preparing Sales Report & you do not want the Data tab to be invisible when it is not in use.

 

Click on Developer tab

From Code group select Visual Basic
 
img3
 
or press ALT + F11 shortcut key to launch VB Editor screen.

Enter the following code in the Data (the sheet you want to auto hide)

Private Sub Worksheet_Deactivate()

ThisWorkbook.Sheets("Data").Visible = False

End Sub
 
img4
 
When you go to next tab, then Data sheet will automatically get invisible. Refer below shown snapshot
 
img5
 
To unhide the Data sheet, you can right click on any sheet & click on Unhide
 
img6
 
Select Data sheet & then click on OK button.
 
img7
 
The Data sheet will get visible.
 
img8
 
In this way, you can auto hide the sheets that you want to hide after using them.
 
 

Leave a Reply

Your email address will not be published. Required fields are marked *

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.