A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

To protect all worksheet simultaneously in a excel workbook



 
 
Thread Tools Display Modes
  #1  
Old June 1st, 2010, 11:55 PM posted to microsoft.public.excel.worksheet.functions
Vimlesh
external usenet poster
 
Posts: 3
Default To protect all worksheet simultaneously in a excel workbook

If we select either few worksheets or all worksheet by holding 'shift' key,
can these all worksheet be protected/unprotected simultaneously using either
same or different passwords for each sheet.
  #2  
Old June 2nd, 2010, 12:17 AM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default To protect all worksheet simultaneously in a excel workbook

Macro to protect all using same password.

Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Protect Password:="justme"
Next n
Application.ScreenUpdating = True
End Sub

And to unprotect all.................................

Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Unprotect Password:="justme"
Next n
Application.ScreenUpdating = True
End Sub

And to protect just selected sheets..........................

Sub Protect_Selected_Sheets()
Set MySheets = ActiveWindow.SelectedSheets
For Each ws In MySheets
ws.Select
ws.Protect Password:="justme"
Next ws
End Sub


Gord Dibben MS Excel MVP

On Tue, 1 Jun 2010 15:55:01 -0700, Vimlesh
wrote:

If we select either few worksheets or all worksheet by holding 'shift' key,
can these all worksheet be protected/unprotected simultaneously using either
same or different passwords for each sheet.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.