locking individual cells?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello!
I am creating a worksheet that i want other users to have access to.
However, there are certain cells that are required by the user to fill out.
Is there a way to lock certain cells that are required and if the user does
not fill in the required cells, then an "error" box would populate (saying:
all required cells must be completed) when they try to save the worksheet?
Please help.

Thank you!!!
 
Hi
- select these cells
- goto 'Format - Cells - Protection' and uncheck 'Locked'
- goto 'Tools - Protection' and protect your sheet
 
Thank you Frank for the quick reply! It is much appreciated. I did as you
suggested below, however, the cell I unchecked the 'Locked' option for is now
the only cell i can type in since the sheet is protected. I need to "lock" a
particular cell so individuals have to fill it in (if this is possible).
Example: If a cell asks a question I absolutely need an answer to, however,
they do not answer it, then I need something that comes up saying this field
(cell) is required to fill in beforing moving on.

I hope this makes sense. Thanks for your help.

Erica
 
Hi
this would require VBA (an event procedure before_save for example)
 
Thanks Frank! Do you have much experience in VBA? Would you be able to help
me with the coding?

Thanks,
Erica
 
Hi
as starting point have a look at:
http://www.cpearson.com/excel/events.htm

you may put the following code in your workbook module (not in a
standard module)
Private Sub Workbook_BeforeClose(Cancel As Boolean)
with me.worksheets("sheet1")
if .range("a1").value="" then
msgbox "Cell A1 on sheet 1 not filled"
cancel=true
end if
end with
End Sub
 

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

Back
Top