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: 1
Default VBA to proctect locked cells in sheet


ok, programmers... I'm stumped. Writing code to protect a group of
sheets, I cannot figure how to prevent users from "Selecting Locked
Cells", which is a choice in the Protect Sheet menu.

According to VBA, the choices for ActiveSheet.PROTECT a

-expression.Protect(Password, DrawingObjects, Contents, Scenarios,
UserInterfaceOnly, AllowFormattingCells, AllowFormattingColumns,
AllowFormattingRows, AllowInsertingColumns, AllowInsertingRows,
AllowInsertingHyperlinks, AllowDeletingColumns, AllowDeletingRows,
AllowSorting, AllowFiltering, AllowUsingPivotTables)-

Current code looks like this:

Code:
--------------------

Sub PROTECT()
'
Sheets("January").Select
ActiveSheet.PROTECT DrawingObjects:=True, Contents:=True, Scenarios:=True,_
AllowFiltering:=True, UserInterfaceOnly:=True
Sheets("February").Select
......
End Sub

--------------------

I am trying to keep the user in ONLY the 'Unlocked' cells within each
sheet. After running the above code, the user is free to move to any
cell within the sheet, locked or not. Of course the contents are
protected from changes, but can still be selected.

Also, when I manually set this option (unchecking "Selecting Locked
Cells"), save and close the file, when re-opened the protection is in
place, yet all cells can once again be selected.

Ideas, anyone?

Thanks...

Bruce


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=382012

 
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
Allowing editing locked cells in a protected sheet in excel phoenix[_2_] Excel Worksheet Functions 1 December 23rd 08 11:50 AM
can a sheet be locked, with exception of some cells in it Shariq Excel Discussion (Misc queries) 1 January 2nd 07 01:20 PM
paste locked cells and unlocked cells in protected sheet Angeline Excel Worksheet Functions 15 November 1st 06 11:51 PM
Locked cells with Protect Sheet. ness Excel Discussion (Misc queries) 2 June 13th 06 07:48 PM
Still can select locked cells in protected sheet Andy New Users to Excel 11 October 29th 05 07:45 PM


All times are GMT +1. The time now is 01:54 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"