ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sheets Protection for group!!!!? (https://www.excelbanter.com/excel-programming/301584-sheets-protection-group.html)

Simon Lloyd[_488_]

Sheets Protection for group!!!!?
 
Does anyone know if there is a way of protecting/unprotecting a group o
sheets in VBA? my current code selects all sheets when a cell i
selected in a certain range, in XL XP the protect unprotect feature
work fine, but i'm trying to use the workbook on a machine that has X
97 and this is where it falls down as it wont use the unprotec
features of XP.

Any ideas????

Simo

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

Sheets Protection for group!!!!?
 
You have to do a sheet at a time.

--
Regards,
Tom Ogilvy

"Simon Lloyd " wrote in message
...
Does anyone know if there is a way of protecting/unprotecting a group of
sheets in VBA? my current code selects all sheets when a cell is
selected in a certain range, in XL XP the protect unprotect features
work fine, but i'm trying to use the workbook on a machine that has XL
97 and this is where it falls down as it wont use the unprotect
features of XP.

Any ideas????

Simon


---
Message posted from http://www.ExcelForum.com/




Paul B[_6_]

Sheets Protection for group!!!!?
 
Simon, here is a way to do all the sheets at once

Sub protect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect
Next ws
End Sub

you may also want to look here for a workaround for grouped sheets
http://www.mcgimpsey.com/excel/prote...ed_sheets.html

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"Simon Lloyd " wrote in message
...
Does anyone know if there is a way of protecting/unprotecting a group of
sheets in VBA? my current code selects all sheets when a cell is
selected in a certain range, in XL XP the protect unprotect features
work fine, but i'm trying to use the workbook on a machine that has XL
97 and this is where it falls down as it wont use the unprotect
features of XP.

Any ideas????

Simon


---
Message posted from http://www.ExcelForum.com/




Tom Ogilvy

Sheets Protection for group!!!!?
 
here is a way to do all the sheets at once

maybe it is a matter of perspective, but I think most would agree you are
doing each sheet individually within a loop. Same as what I suggested.
Your link does the same - same as what I suggested. Just clarification for
Simon since we were communicating outside the newsgroup.

--
Regards,
Tom Ogilvy

"Paul B" wrote in message
...
Simon, here is a way to do all the sheets at once

Sub protect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect
Next ws
End Sub

you may also want to look here for a workaround for grouped sheets
http://www.mcgimpsey.com/excel/prote...ed_sheets.html

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"Simon Lloyd " wrote in

message
...
Does anyone know if there is a way of protecting/unprotecting a group of
sheets in VBA? my current code selects all sheets when a cell is
selected in a certain range, in XL XP the protect unprotect features
work fine, but i'm trying to use the workbook on a machine that has XL
97 and this is where it falls down as it wont use the unprotect
features of XP.

Any ideas????

Simon


---
Message posted from http://www.ExcelForum.com/







All times are GMT +1. The time now is 09:53 PM.

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