Sheets Protection for group!!!!?

  • Thread starter Thread starter Simon Lloyd
  • Start date Start date
S

Simon Lloyd

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
 
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/protect_grouped_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 **
 
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 said:
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/protect_grouped_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 **
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top