Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-05-2015, 08:56 AM
Cardinal2 Cardinal2 is offline Unprotect Cells Windows 7 64bit Unprotect Cells Office 2007
Novice
Unprotect Cells
 
Join Date: Feb 2013
Posts: 10
Cardinal2 is on a distinguished road
Lightbulb 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
Reply With Quote
  #2  
Old 01-06-2015, 12:18 AM
gmayor's Avatar
gmayor gmayor is offline Unprotect Cells Windows 7 64bit Unprotect Cells Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,106
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 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
  #3  
Old 01-06-2015, 05:15 PM
Cardinal2 Cardinal2 is offline Unprotect Cells Windows 7 64bit Unprotect Cells Office 2007
Novice
Unprotect Cells
 
Join Date: Feb 2013
Posts: 10
Cardinal2 is on a distinguished road
Smile Unprotect cells

Excellent works perfectly.
thank you very much
Cardinal3
Reply With Quote
Reply

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

Other Forums: Access Forums

All times are GMT -7. The time now is 06:57 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft