Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have 2 codes I stole from here, one to protect the selected sheets, the other to unprotect them. Obviously I need to be able to run them separatly. I added the first by right clicking the excel logo in upper left and pasted it in. But now how do I enter the second one? I'm really new at VBA and macros...
Public Sub ProtectSelectedSheets Const PWORD As String = "drowssap" Dim wkSht As Worksheet For Each wkSht In ActiveWindow.SelectedSheets wkSht.Protect Password:=PWORD Next wkSht End Sub Public Sub UnProtectMultipleSheets() Const Pword As String = "drowssap" Dim WkSht As Worksheet For Each WkSht In Worksheets WkSht.Unprotect Pword Next WkSht End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protecting and Unprotecting several worksheets at one time | Excel Discussion (Misc queries) | |||
protecting and unprotecting | Excel Worksheet Functions | |||
Macro for protecting and unprotecting multiple worksheets | Excel Discussion (Misc queries) | |||
PROTECTING/UNPROTECTING SHEETS | Excel Discussion (Misc queries) | |||
Protecting and Unprotecting multiple sheets | Excel Programming |