Lock the cell once enter the data

G

Guest

Hi,

I sthere anyway can you lock and unlock the cell once you enter the data?

For example : If enter "Yes" to an greement on Cell C50. I want to lock the
cell, so nobody can change the answer except myself. I am sure we can use
helper cell to create somekind of formula which I am not sure what it is?

Thanks to advise

Dinesh
 
O

Otto Moehrbach

All cells are set to "Locked" by default. But the Locked/Unlocked setting
does not mean anything until the sheet is protected. With the sheet
protected, the locked cells cannot be changed.
In your case, I would unlock all the cells on the sheet, then when any
entry is made to any cell in some specific group of cells, I would Unprotect
the sheet, set that one cell to Locked, and Protect the sheet again. You
need to do this with VBA to prevent the user from changing any occupied
cell. The following macro is an example:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect
Target.Locked = True
ActiveSheet.Protect
End Sub
The macro will execute whenever ANY cell is changed. I'm sure that you want
to restrict this action to a specific group or range of cells. Post back if
you need more. HTH Otto
 

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