Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 22
Send a message via Skype™ to Bakar
Angry macros to hide sheet with protection

hi everyone
I want to have a macros to hide sheet 1
Scenario I am on sheet 2 I click on a command button and I get the message box for unprotect sheet, I put the password and click ok Sheet 1 is unhide if I click on cancel I stay on sheet 2 ,when password is ok and when I am on sheet 2 I have another command button when I click on I return on Sheet 1 and sheet 2 is hiding again with the protection.

Thnxs very much for ur precious help
Bakar

Last edited by Bakar : October 27th 12 at 11:20 AM Reason: Solved
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default macros to hide sheet with protection

Bakar,

Copy this to a new module, then add a button to sheet1 that links to the "ReHide" macro and a button to sheet2 that links to the "UnHide" macro. You set your password with the very first line of the module, so you may want to password protect the module as well. Here is the code:

Const pWord As String = "Hello123"


Sub UnHide()
If InputBox("Please enter password to open worksheet", "Password?", _
"Enter Password") = pWord Then
Sheet1.Visible = xlSheetVisible
Sheet1.Activate
End If

End Sub

Sub ReHide()
Sheet1.Visible = xlSheetVeryHidden
End Sub
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
Excel Data Protection Best Practice: AKA: Real Sheet Protection Mushman(Woof!)[_2_] Excel Discussion (Misc queries) 4 December 30th 09 02:20 AM
Excel Data Protection- AKA: Sheet/Macro Password Protection Mushman(Woof!) Setting up and Configuration of Excel 0 December 29th 09 07:50 AM
how to hide a list of macros in excel 2000 without password protection Padam Setting up and Configuration of Excel 1 July 12th 06 09:10 PM
how to hide a list of macros without password protection Padam Excel Worksheet Functions 1 July 12th 06 11:30 AM
have macros complete and enter passwords for sheet protection. nick-ipswich Excel Programming 1 March 13th 05 05:52 AM


All times are GMT +1. The time now is 02:51 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"