Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Can we protact two or more sheets simultaneously using one password.
Similarly can we unprotect two or more sheets in single command having one password. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi Garg Swadesh,
No, they have to be done one at a time, but you could use a macro to automate the processes, thus requiring the user to input the password only once. For example, the following 'ProtectAllSheets' code protects all unprotected sheets, while the 'UnprotectAllSheets' code does the opposite: Sub ProtectAllSheets() Dim wkSheet As Worksheet For Each wkSheet In ActiveWorkbook.Worksheets If wkSheet.ProtectContents < True Then wkSheet.Protect Password:=InputBox("Please enter the password") End If Next wkSheet End Sub Sub UnprotectAllSheets() Dim wkSheet As Worksheet For Each wkSheet In ActiveWorkbook.Worksheets If wkSheet.ProtectContents = True Then wkSheet.Unprotect Password:=InputBox("Please enter the password") End If Next wkSheet End Sub Cheers -- macropod [MVP - Microsoft Word] ------------------------- "Garg Swadesh" <Garg wrote in message ... Can we protact two or more sheets simultaneously using one password. Similarly can we unprotect two or more sheets in single command having one password. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() use a looping macro to do either -- Don Guillett SalesAid Software "Garg Swadesh" <Garg wrote in message ... Can we protact two or more sheets simultaneously using one password. Similarly can we unprotect two or more sheets in single command having one password. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|