Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Sussex Fran
 
Posts: n/a
Default Can I protect a range of worksheets in a book with one action?

If a workbook contains, say 20 worksheets, is there a way of
protecting/unprotecting all the sheets at the same time to avoid going into
each one separately to protect?
Using Office Excel 2003.

  #2   Report Post  
Martin
 
Posts: n/a
Default

No I don't think so unless you create a macro.
--
Regards,

Martin


"Sussex Fran" wrote:

If a workbook contains, say 20 worksheets, is there a way of
protecting/unprotecting all the sheets at the same time to avoid going into
each one separately to protect?
Using Office Excel 2003.

  #3   Report Post  
Jason Morin
 
Posts: n/a
Default

Use these 2 macros to protect and unprotect all sheets:

Sub ProtectAllSheets()
Dim ws As Worksheet
Dim strPassWord As String
strPassWord = "apple" '<--- set password here
For Each ws In ThisWorkbook.Worksheets
ws.Protect Password:=strPassWord
Next
End Sub

Sub UnprotectAllSheets()
Dim ws As Worksheet
Dim strPassWord As String
strPassWord = "apple" '<--- set password here
For Each ws In ThisWorkbook.Worksheets
ws.Unprotect Password:=strPassWord
Next
End Sub

---
Put the code in a regular/standard module. If you've never worked with
macros before, see:

http://office.microsoft.com/en-us/as...047111033.aspx

and

http://www.mcgimpsey.com/excel/modules.html

HTH
Jason
Atlanta, GA

"Sussex Fran" wrote:

If a workbook contains, say 20 worksheets, is there a way of
protecting/unprotecting all the sheets at the same time to avoid going into
each one separately to protect?
Using Office Excel 2003.

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
How to set print range for a number of worksheets tntvk Excel Discussion (Misc queries) 5 December 12th 05 05:00 PM
Moving worksheets in a book Drakkip Excel Worksheet Functions 5 February 18th 05 01:24 AM
How to protect and unprotect 30 worksheets in a file every month . Protect & Unprotect Several Worksheets Excel Worksheet Functions 4 January 10th 05 01:29 PM
Macro with Range of Worksheets Chris E. New Users to Excel 8 December 3rd 04 04:56 PM
SUMIF across a range of worksheets Mike@Q Excel Worksheet Functions 3 November 24th 04 02:36 PM


All times are GMT +1. The time now is 12:27 AM.

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

About Us

"It's about Microsoft Excel"