Limit Visibility of a worksheet

  • Thread starter Thread starter Tdahlman
  • Start date Start date
T

Tdahlman

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SUMIF 1
Code to format cells on several worksheets 2
VLOOKUP 7
Custom Toolbar Visibility 2
Multiple Worksheets 6
combining IF and AND 5
Need to merge worksheets - Excel 2003 0
Macro password-All sheets visible 4

Back
Top