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  

Can I protect a range of worksheets in a book with one action?



 
 
Thread Tools Display Modes
  #1  
Old June 10th, 2005, 01:37 PM
Sussex Fran
external usenet poster
 
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  
Old June 10th, 2005, 02:54 PM
Martin
external usenet poster
 
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  
Old June 10th, 2005, 03:02 PM
Jason Morin
external usenet poster
 
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.

 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 contacts folders Larry Tackett Contacts 21 October 21st, 2005 12:45 PM
Moving worksheets in a book Drakkip Worksheet Functions 5 February 18th, 2005 01:24 AM
recover my Windows Address Book mike Outlook Express 1 June 6th, 2004 05:22 AM


All times are GMT +1. The time now is 02:55 PM.


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