Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
How do I hide a worksheet in Excel and use a password to un-hide the worksheet?
|
#2
![]() |
|||
|
|||
![]()
To hide:
Sub Hide_Ws() Sheets("Sheet1").Visible = xlSheetVeryHidden End Sub ------------- To unhide: Sub Unhide_Ws() Dim psword As String psword = InputBox("Enter password to unhide worksheet.") If psword = "" Then Exit Sub If psword = "1234" Then Sheets("Sheet1").Visible = True Else MsgBox "Incorrect password." End If End Sub --- Note that when hiding the worksheet sheet, it sets it at "veryhidden", meaning that it cannot be unhidden from the Format menu. Password is currently set to "1234". HTH Jason Atlanta, GA -----Original Message----- How do I hide a worksheet in Excel and use a password to un-hide the worksheet? . |
#3
![]() |
|||
|
|||
![]()
Hi
Additionally, you have to protect the VBA-project with password too - otherwise the user can activate VBA editor and change worksheets Visible propertie manually back to xlSheetVisible witout any password. -- Arvi Laanemets (When sending e-mail, use address arvil<Attarkon.ee) "Jason Morin" wrote in message ... To hide: Sub Hide_Ws() Sheets("Sheet1").Visible = xlSheetVeryHidden End Sub ------------- To unhide: Sub Unhide_Ws() Dim psword As String psword = InputBox("Enter password to unhide worksheet.") If psword = "" Then Exit Sub If psword = "1234" Then Sheets("Sheet1").Visible = True Else MsgBox "Incorrect password." End If End Sub --- Note that when hiding the worksheet sheet, it sets it at "veryhidden", meaning that it cannot be unhidden from the Format menu. Password is currently set to "1234". HTH Jason Atlanta, GA -----Original Message----- How do I hide a worksheet in Excel and use a password to un-hide the worksheet? . |
#4
![]() |
|||
|
|||
![]()
Yep, you're absolutely right. Forgot to mention that.
Jason -----Original Message----- Hi Additionally, you have to protect the VBA-project with password too - otherwise the user can activate VBA editor and change worksheets Visible propertie manually back to xlSheetVisible witout any password. -- Arvi Laanemets (When sending e-mail, use address arvil<Attarkon.ee) "Jason Morin" wrote in message ... To hide: Sub Hide_Ws() Sheets("Sheet1").Visible = xlSheetVeryHidden End Sub ------------- To unhide: Sub Unhide_Ws() Dim psword As String psword = InputBox("Enter password to unhide worksheet.") If psword = "" Then Exit Sub If psword = "1234" Then Sheets("Sheet1").Visible = True Else MsgBox "Incorrect password." End If End Sub --- Note that when hiding the worksheet sheet, it sets it at "veryhidden", meaning that it cannot be unhidden from the Format menu. Password is currently set to "1234". HTH Jason Atlanta, GA -----Original Message----- How do I hide a worksheet in Excel and use a password to un-hide the worksheet? . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|