ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Multiple Worksheets Protection (https://www.excelbanter.com/excel-programming/436972-multiple-worksheets-protection.html)

Leslie Williams

Multiple Worksheets Protection
 
I have 75+ worksheets that need to be protected and unprotected at the same
time. I have used a macro to achieve this process, however I now have
created a pivot table to narrow the information into a separate report. One
of the worksheets is a summay of all data from each sheet, and this
particular worksheet is the source for my pivot table. My problem is that
when I use the protect all macro, the pivot table is included and no changes
can be made. This table basically has one field that requires the user to
make a selection from a drop down cell and the report is then updated with
the information. Is there any way to get the macro to protect a range of
worksheets that does not include the pivot table sheet? I am currently using
Office 2007 but others using this spreadsheet have older versions of Office
2003.
--
Thanks,
Leslie

John

Multiple Worksheets Protection
 
Leslie,
always helpful if you include copy of the macro in question on this board.

See if following helps you - change PivotSheetName as required.

Sub ProtectSheets()
Dim sh As Variant
For Each sh In ThisWorkbook.Sheets

If sh.Name < "PivotSheetName" Then sh.Protect

Next sh

End Sub
--
jb


"Leslie Williams" wrote:

I have 75+ worksheets that need to be protected and unprotected at the same
time. I have used a macro to achieve this process, however I now have
created a pivot table to narrow the information into a separate report. One
of the worksheets is a summay of all data from each sheet, and this
particular worksheet is the source for my pivot table. My problem is that
when I use the protect all macro, the pivot table is included and no changes
can be made. This table basically has one field that requires the user to
make a selection from a drop down cell and the report is then updated with
the information. Is there any way to get the macro to protect a range of
worksheets that does not include the pivot table sheet? I am currently using
Office 2007 but others using this spreadsheet have older versions of Office
2003.
--
Thanks,
Leslie



All times are GMT +1. The time now is 05:25 PM.

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