Hi, you can hide a sheet by selecting Format|Sheet|hide. Unfortunately this wont stop nosey users as sheets can be unhidden by using the same method. To hide the sheet and prevent showing it via the menu you need to run a macro.
Heres an example...
Code:
Sub HideSheet()
'Replace Sheet1 text with the name of your sheet
Sheets("Sheet1").Visible = xlVeryHidden
End Sub
Paste the below code to ThisWorkbook
*assuming that you want to hide sheet2*
Private Sub Workbook_Open()
Worksheets("Sheet2").Visible = False
End Sub
Sub reveal()
Dim passwd As String
Dim passwd1 As String
passwd1 = "password"
If Worksheets("sheet2").Visible = False Then
If InputBox("Authority to view hidden data...", "Password required!") = passwd1 Then
Worksheets("sheet2").Visible = True
Else
Worksheets("sheet2").Visible = False
MsgBox ("You are not authorized." & vbOKOnly)
End If
Else
Worksheets("sheet2").Visible = False
End If
End Sub
-------------------
If you want to hide other sheet or you've renamed the sheets
then replace all sheet2 with "name" where name is the name of your sheet.
Hi anis & dr_shivan. Note that Sheet1.Visible = False is the same as you manually hiding the sheet which means it can be revealed again by simply selecting Format|Sheet|Unhide. See my post above regarding how to make it "very" hidden.
After a sheet is hidden using the xlveryhidden constant then the workbook structure can be protected. However, you need to bear in mind Excel does not contain bullet proof security.
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.