ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Limit Visibility of a worksheet (https://www.excelbanter.com/excel-discussion-misc-queries/179764-limit-visibility-worksheet.html)

Tdahlman

Limit Visibility of a worksheet
 
I have multiple sheets in a workbook.
I want to limit the visibility of 2 of the sheets so that you have to have a
password to view them.

How do I go about doing this.

Thanks in advance,
Travis Dahlman

Tom Hutchins

Limit Visibility of a worksheet
 
One way, using macros:

Paste these in a VBA module in your workbook. Change the sheet names and
password as desired.

Sub HideSheets()
Sheets("Sheet2").Visible = xlSheetVeryHidden
Sheets("Sheet3").Visible = xlSheetVeryHidden
End Sub

Sub UnhideSheets()
Dim ret
Const Pwd = "tTyY7&uU"
ret = InputBox("Password to unhide sheets", "Unhide Sheets")
If ret = Pwd$ Then
Sheets("Sheet2").Visible = xlSheetVisible
Sheets("Sheet3").Visible = xlSheetVisible
End If
End Sub

These macros could be called from buttons on another sheet. You should also
password protect the VBAProject for the workbook. This will prevent most
users from seeing the sheets or the pasword, but the security in an Excel
workbook is far from unbreakable once the workbook is open.

Hope this helps,

Hutch

"Tdahlman" wrote:

I have multiple sheets in a workbook.
I want to limit the visibility of 2 of the sheets so that you have to have a
password to view them.

How do I go about doing this.

Thanks in advance,
Travis Dahlman



All times are GMT +1. The time now is 02:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com