Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dchung
 
Posts: n/a
Default How do I hide a worksheet in Excel and use a password to un-hide .

How do I hide a worksheet in Excel and use a password to un-hide the worksheet?
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

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   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

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   Report Post  
Jason Morin
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"