![]() |
|
|
|
#1
|
||||
|
||||
|
Interesting, Looks like you had to to unlock all the cells first, and then lock the cells you want protected before you protect the sheet. |
|
#2
|
|||
|
|||
|
Quote:
Code:
Cells.Locked = False Columns(1).Locked = True ActiveSheet.Protect The second time when the sheet is protected, there should be an error when this code is run: Code:
Cells.Locked = False Code:
If ActiveSheet.ProtectContents = True Then ActiveSheet.Unprotect End If '''''''''''''''''''''' Cells.Locked = False Columns(1).Locked = True ActiveSheet.Protect it's good practice first to check before you code. So "If a condition occurs do this; if not, do that." should be done always to avoid "strange" errors. It may prevent me from always asking questions. I can work it out sometimes if it is practised. |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Protect / Lock Cells / Print Set-up? | meggenm | Excel | 3 | 01-26-2012 09:57 PM |
| protect and unprotect in shared excel | mark-gabb | Excel | 0 | 01-09-2012 07:30 PM |
| Excel 2010 Format cells to use as Gantt or Plan | Kizzie | Excel | 0 | 12-13-2011 02:31 AM |
password protect excel file?
|
Dawg751 | Excel | 2 | 01-28-2010 06:23 AM |
Importing individual cells from Excel to Word
|
themangoagent | Word | 1 | 10-12-2009 08:14 AM |