Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Amend the Code
Dear Experts, please amend the following code to turn off the Workbook & Worksheet protections while the following code runs & turn on protection again at the end. Workbook password "xyz" worksheet password "xyz" ------------------------------------------------------------------------------------------ Sub Button1_Click() Dim Pass As String Pass = InputBoxDK("Please enter your password", "Hide Sheets") If Pass = "123" Then If Worksheets("a").Visible = True Then Sheets(Array("a", "b", "c", "d")).Visible = False Else Sheets("a").Visible = True Sheets("b").Visible = True Sheets("c").Visible = True Sheets("d").Visible = True End If Else MsgBox "Incorrect password", vbCritical, "Invalid Password" End If End Sub -------------------------------------------------------------------------------------------------- Thanks for your efforts. S h a n -- shan_in_dubai ------------------------------------------------------------------------ shan_in_dubai's Profile: http://www.excelforum.com/member.php...o&userid=25307 View this thread: http://www.excelforum.com/showthread...hreadid=387928 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Amend the Code
Like this :- Worksheets("A").Unprotect password:="xx" Workbooks("Book1.xls").Unprotect password:="xx" Don't forget to re-protect afterwards -- Brian ----------------------------------------------------------------------- BrianB's Profile: http://www.excelforum.com/member.php...tinfo&userid=5 View this thread: http://www.excelforum.com/showthread.php?threadid=38792 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
amend a VB code please | Excel Discussion (Misc queries) | |||
Amend code | Excel Programming | |||
Amend open Workbook code | Excel Programming | |||
Amend code or change it completely? | Excel Programming | |||
Amend form code to allow an option | Excel Programming |