Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
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.


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
PROTECT MULTIPLE SHEETS IN EXCEL WORKBOOK SIMULTANEOUSLY? SEAKAPTAIN Excel Discussion (Misc queries) 1 October 2nd 08 07:12 PM
How do I password protect a single worksheet within a workbook f Lorne Excel Discussion (Misc queries) 1 July 3rd 07 05:21 AM
Protect Workbook vs Worksheet?? Dan B Excel Worksheet Functions 3 November 7th 05 09:02 PM
How can I protect several sheets in a workbook simultaneously? Fran crisp Excel Discussion (Misc queries) 1 June 20th 05 12:15 PM
How do I protect a worksheet from being opened inside a workbook J. Robinson Excel Discussion (Misc queries) 2 June 1st 05 03:40 PM


All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"