Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Excel 2010:  How to Protect a Worksheet

Posted on 2013-01-25
5
Medium Priority
?
481 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

618 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