#1
|
|||
|
|||
Unprotect Cells
I have a spreadsheet that I unprotect, copy date into and then protect again. I use the commands "Sheets("MainDataEntryForm").Unprotect Password:="" Sheets("MainDataEntryForm").protect Password:="" but I would after protect the main data form, I would add a command to unprotect cells , B2, B7, b10 so that users can enter data into those specific cells only but no other cells. any help would be appreciated. thanks Cardinal2 |
#2
|
||||
|
||||
You need to 'unprotect' the cells before protecting the sheet. e.g. as follows. You could include the date cell (as here B1) in the list of unprotected cells:
Code:
With Sheets("MainDataEntryForm") .Unprotect Password:="" .Range("B1,B2,B7,B10").Locked = False .Protect Password:="", UserInterfaceOnly:=True .Range("B1") = Date End With
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
Unprotect cells
Excellent works perfectly.
thank you very much Cardinal3 |
Tags |
unprotect cells |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to unprotect and search a Word2007 doc? | pstein | Word | 1 | 05-31-2013 02:50 AM |
protect and unprotect in shared excel | mark-gabb | Excel | 0 | 01-09-2012 07:30 PM |
ADD in That can unprotect the documents. | aligahk06 | Word | 0 | 07-12-2010 04:55 AM |
Unprotect header in Word | Fran | Word | 0 | 12-23-2008 03:42 AM |