LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Protection Properties on WorkSheets

Hi, I have some code that I run on a lot of my workbooks which protects
all the worksheets with my password "PASS" the only thing is, is
that some of the properties of the protect function are not kept when
it is run. Specifically I want to have the sheet protected and only
want users to be able to 'Select unlocked cells' but it seems when
the code is run it enables users to 'Select locked cells' can
anyone help??

Function ProtectAll()

Application.ScreenUpdating = False
Dim Sh As Worksheet

For Each Sh In Worksheets
Sh.Visible = xlSheetVisible
Next

For Each Sh In Worksheets
Sh.Protect "PASS"
Next

For Each Sh In Worksheets
Sh.Select
With ActiveWindow
.DisplayHeadings = False
End With
Next

For Each Sh In Worksheets
Sh.Visible = xlHidden
Sheets("Cover").Visible = xlSheetVisible
Sheets("Cover").Select
Next

ActiveWorkbook.Protect "PASS"
Application.ScreenUpdating = True

End Function

Regards,

Scott Spence

 
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
Button properties blank: protection problem? George[_3_] Excel Discussion (Misc queries) 6 November 12th 07 09:01 PM
Protection of worksheets Asiageek Charts and Charting in Excel 1 September 5th 07 05:34 PM
Custom properties for worksheets Thelonious Monk Excel Programming 3 September 11th 06 03:00 AM
Setting PageSetup Properties in Multiple Worksheets Josh Sale Excel Programming 10 February 28th 06 06:23 PM
Code cancels protection properties gavmer[_68_] Excel Programming 3 September 8th 04 07:47 AM


All times are GMT +1. The time now is 08:44 AM.

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

About Us

"It's about Microsoft Excel"