Solved

Excel 2010:  How to Protect a Worksheet

Posted on 2013-01-25
5
425 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

705 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

19 Experts available now in Live!

Get 1:1 Help Now