Solved

Excel 2010:  How to Protect a Worksheet

Posted on 2013-01-25
5
446 Views
Last Modified: 2013-02-06
I have a worksheet that several people use.  I want to allow them to make entries on this worksheet because we all use it but I do not want them to be able change anything on the worksheet i.e. Delete prior data or a few formulas that I have in a couple of the cells already in the worksheet.  These cells should never be touched as they are automatic.    They also should not be able to delete prior entries made.

So in a nutshell:  

Be able to add data to a specified range of cells.

Cannot delete prior data i.e. They can't go back to last week entries on the spreadsheet and delete those.

Formula cells protected.

Any help with this is greatly appreciated.
0
Comment
Question by:itsmevic
  • 2
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
webtechgal earned 125 total points
ID: 38821060
I think you want to protect cells of previous data, but not the whole worksheet?

Take a look at this resource -

http://spreadsheetpage.com/index.php/tip/spreadsheet_protection_faq1/
0
 
LVL 20

Assisted Solution

by:clarkscott
clarkscott earned 250 total points
ID: 38821758
I wrote a routine that locks worksheet cells determined by their backcolor.
For instance, all user edited cells are green background.
On the event WORKSHEET - SELECTIONCHANGE....


'---- this example says to lock the cell if the background is white---
If Range(Target.address).interior.color =  16777215 then
       Selection.locked = true
else
       Selection.locked = false
end if


As the user moves from cell to cell, the cell is locked if it's white.

Scott C
0
 
LVL 26

Assisted Solution

by:redmondb
redmondb earned 125 total points
ID: 38822616
Hi, itsmevic.

Please see attached as a proof of concept. I'm sure that it's too aggressive about protecting earlier data - once the user has filled all data on a row and then selects the next line, the "filled" data cells are locked and those on the new line are unlocked.

So, a couple of requests, please...
(1) What are the rules for which earlier rows the user is allowed to change?
(2) Which columns are the users allowed to enter data into and which columns have the formulas?

Thanks,
Brian.Add-Only.xlsm
0
 
LVL 20

Assisted Solution

by:clarkscott
clarkscott earned 250 total points
ID: 38824129
Here's a quick example of my lock scheme.
Please view Sheet1.  You many change any WHITE cell.  You can't change the green ones.

The code is in the sheet1 - selectionchange event

Scott C
Lock-Test.xls
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38860714
Thanks, itsmevic.

For the sake of others who may want to do similar things, what did you go with in the end?

Thanks,
Brian.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
: Microsoft Office Collaborate for free and online versions of Microsoft  Word, Excel, Powerpoint, OneNote, Onedrive , Email, Calendar etc. In short we can say that Microsoft office is a suite of servers, applications and services developed by  Micr…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now