View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Excel Worksheet protection

Bill

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

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

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 Sat, 5 Jan 2008 09:29:00 -0800, BillFitz
wrote:

I tried that, including the input of a Password, but found that the Password
was not correctly applied, with the result that the Unprotect worked without
using a Password

"CmK" wrote:

I think the best way is to write a macro


"BillFitz" wrote:

Is there a simple way to Protect/Unprotect individual worksheets in a file
without having to visit each worksheet.
I use a file containing 31 worksheets for each day of month and I can make
changes each month, to update for new product lines on each sheet, across all
worksheets using the Group function. However, in order to Unprotect and then
Protect each worksheet individually is a time consuming process.