LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 109
Default Protection macro

Thanks Mike, That's brilliant! And much quicker putting the below before
each and every code, thank-you.

Sheets("Drainage Accessories Input").Select
ActiveSheet.Unprotect
Sheets("Drainage Input").Select
ActiveSheet.Unprotect
Sheets("Accessories").Select
ActiveSheet.Unprotect
Sheets("Summary Tables").Select
ActiveSheet.Unprotect

Sheets("Drainage Accessories Input").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Drainage Input").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Accessories").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("Summary Tables").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True




"Mike H" wrote:

You would have to write one.

This protects all sheets if they are unprotected and vice versa. Simply call
it from your sub

Sub sistence()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
If ws.ProtectContents Then
ws.Unprotect Password:="MyPass"
Else
ws.Protect Password:="MyPass"
End If
Next
End Sub

Mike

"Neil Pearce" wrote:

Is there a macro that will automatically unprotect all worksheets when any
other marco is run?

More porblematic one would assume is a macro that automatically protects all
worksheets when another macro ends?


 
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
password protection macro - HELP???? Teddy-B Excel Discussion (Misc queries) 4 October 10th 08 03:55 PM
Macro and row protection RoyG Excel Discussion (Misc queries) 1 February 19th 08 12:05 AM
Protection Macro Spheon Excel Discussion (Misc queries) 5 July 29th 06 01:16 PM
Macro Protection fodman New Users to Excel 3 June 24th 06 10:01 PM
macro for protection ynissel Excel Discussion (Misc queries) 3 August 3rd 05 09:52 PM


All times are GMT +1. The time now is 08:15 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"