#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Unprotect

Hello,

I have a document with three sheets. One of them is hidden (standard
situation). I would like to create a button in one of the other sheets to
automatically change the property of the hidden sheet to visible when I push
the button. But the change to visible should be confirmed by a password which
is preset. If an incorrect password is entered the property of the sheet
remainds hidden. How can I achieve this?

Thanx in advance.

Noepie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Unprotect

Sub unhide_sht1()
pword = InputBox("Enter the password")
If pword = "qwert" Then
Sheets("Sheet1").Visible = True
Else
MsgBox "Incorrect Password"
End If
End Sub

Note: Sheet1 should be set to xlveryhidden or users can unhide simply by
FormatSheetUnhide

Lock the code from view by setting ProjectProperties to locked.


Gord Dibben MS Excel MVP


On Wed, 24 Dec 2008 09:41:01 -0800, Noepie
wrote:

Hello,

I have a document with three sheets. One of them is hidden (standard
situation). I would like to create a button in one of the other sheets to
automatically change the property of the hidden sheet to visible when I push
the button. But the change to visible should be confirmed by a password which
is preset. If an incorrect password is entered the property of the sheet
remainds hidden. How can I achieve this?

Thanx in advance.

Noepie


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unprotect


Noepie;158755 Wrote:
Hello,

I have a document with three sheets. One of them is hidden (standard
situation). I would like to create a button in one of the other sheets
to
automatically change the property of the hidden sheet to visible when I
push
the button. But the change to visible should be confirmed by a password
which
is preset. If an incorrect password is entered the property of the
sheet
remainds hidden. How can I achieve this?

Thanx in advance.

Noepie

You could also hide the sheet if it is visible in the same macro.
Sub unhide_sht1()
If Sheets("Sheet1").Visible = xlSheetVisible Then
Sheets("Sheet1").Visible = xlSheetVeryHidden
Else
pword = InputBox("Enter the password")
If pword = "qwert" Then
Sheets("Sheet1").Visible = xlSheetVisible
Else
MsgBox "Incorrect Password"
End If
End If
End Sub


--
mikeaj72
------------------------------------------------------------------------
mikeaj72's Profile: http://www.thecodecage.com/forumz/member.php?userid=46
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=44054

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I unprotect a spreadsheet? Sofiya Excel Worksheet Functions 1 October 13th 08 04:30 PM
unprotect workbook Deb Excel Discussion (Misc queries) 2 February 9th 07 07:40 PM
Unprotect Conditional Formatting Excel Discussion (Misc queries) 3 September 5th 05 02:49 PM
Unprotect via prompt gavmer[_81_] Excel Programming 1 September 24th 04 03:44 AM
Unprotect via prompt gavmer[_80_] Excel Programming 1 September 23rd 04 08:58 AM


All times are GMT +1. The time now is 11:52 AM.

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

About Us

"It's about Microsoft Excel"