?
Solved

Excel 2010:  How to Protect a Worksheet

Posted on 2013-01-25
5
Medium Priority
?
487 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 500 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 1000 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 500 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 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

830 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