Protect cells but allow for user input.

I

iperlovsky

I want to create a form to input data (either copy and pasted from another
workbook or simply typed in). There will be a range of cells where to enter
data (columns A:G) that will be unprotected; the rest of the worksheet will
be protected. Is there a sub routine that I could apply in the code window
that will allow the user to manipulate the input data in any way other than
deleting whole rows, whole columns, or removing cells by cutting them,
cutting rows or cutting columns. That way for columns A:G the user could
type/paste data, delete or clear contents, but not delete or cut
cells/rows/columns such that other cells would shift in the process. Any
advice would be greatly appreciated.

IP
 
N

Neptune Dinosaur

All you need to do is unlock the cells that you want the user to be able to
input to, and Protect the sheet. That stops people from deleting any rows or
columns in the sheet, even rows & columns that have unlocked cells. Users
would still be able to delete the whole sheet, so to prevent that you would
Protect the workbook (This all works in version 2003, anyway).

By the way, if you are going to Protect, you should put a password on the
protection; otherwise it isn't really protection at all (like giving a
soldier a gun but no bullets).
 
N

Neptune Dinosaur

Well, I don't really understand what the problem is with a user cutting the
contents of cells. You seem to be happy to let them delete or overwrite the
contents of cells. Is being able to cut the contents such a bad thing? It
doesn't "cut" the cell; just the contents.

I don't know of any way within Excel or VBA to prevent the use of "Cut" that
will not also prevent a user from editing and deleting the contents of cells
in the normal way using the keyboard. You could try posting your question on
the VBA site -someone might know a way of doing this via Windows. Functions
like Cut, Copy and Paste are actually operating system (Windows) functions
rather than Excel [or Word] functions.



- - - - - - -
Time is just the thing that keeps everything from happening all at once
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top