Thread: Unprotect Cells
View Single Post
 
Old 01-06-2015, 12:18 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote