PC Review


Reply
Thread Tools Rate Thread

How do I hide a worksheet in Excel and use a password to un-hide .

 
 
=?Utf-8?B?RGNodW5n?=
Guest
Posts: n/a
 
      2nd Dec 2004
How do I hide a worksheet in Excel and use a password to un-hide the worksheet?
 
Reply With Quote
 
 
 
 
Jason Morin
Guest
Posts: n/a
 
      2nd Dec 2004
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 With Quote
 
Arvi Laanemets
Guest
Posts: n/a
 
      2nd Dec 2004
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<At>tarkon.ee)



"Jason Morin" <(E-Mail Removed)> wrote in message
news:05f201c4d825$eaa7edc0$(E-Mail Removed)...
> 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 With Quote
 
Jason Morin
Guest
Posts: n/a
 
      2nd Dec 2004
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<At>tarkon.ee)
>
>
>
>"Jason Morin" <(E-Mail Removed)> wrote

in message
>news:05f201c4d825$eaa7edc0$(E-Mail Removed)...
>> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set password for multiple worksheet and to hide ? Mah Microsoft Excel New Users 1 12th Jun 2008 10:35 AM
Hide and password protect a worksheet Oldjay Microsoft Excel Misc 4 30th Apr 2008 05:33 PM
hide a column in a worksheet and password protect eoreality Microsoft Excel Misc 1 8th Feb 2006 02:42 AM
is there a way to hide a whole worksheet in excel? =?Utf-8?B?TWFyaW9uIE1jRmFybGFuZQ==?= Microsoft Excel Misc 2 14th Nov 2005 12:44 AM
How to hide a worksheet and set a password to protect someone else unhide it. Shu Microsoft Excel Programming 2 28th Mar 2004 04:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:05 PM.