Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default 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/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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/





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ability to Group and Ungroup while in Protection Mode FredL Excel Discussion (Misc queries) 0 January 15th 10 12:45 AM
Sheet protection and "Group and Outline" OkieViking Excel Discussion (Misc queries) 9 May 22nd 07 05:17 PM
please help . access group and outline with protection on darren Excel Discussion (Misc queries) 1 March 4th 06 02:59 PM
view group and outline with protection on derwood Excel Discussion (Misc queries) 1 February 27th 06 02:01 AM
group box protection SWEdwards Excel Discussion (Misc queries) 2 September 7th 05 11:59 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"