ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel Worksheet protection (https://www.excelbanter.com/excel-discussion-misc-queries/171810-excel-worksheet-protection.html)

BillFitz

Excel Worksheet protection
 
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.

CmK

Excel Worksheet protection
 
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.


BillFitz

Excel Worksheet protection
 
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.


Gord Dibben

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.




All times are GMT +1. The time now is 02:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com