I want to lock the worksheet when text appears in a specific cell,
kind of like a lock out once final approval has been made to prevent any other user altering the appoved ammout.
Can anyone help

Locking worksheet
-
-
-
Re: Locking worksheet
It would be something similar to:
CodePrivate Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" Then Me.Protect "Password" End If End Sub
in the worksheet module. Change the address to your cell address, but make sure to keep the $A$1 format because a simple A1 won't work. You have to keep the "$" signs.
-
Re: Locking worksheet
Thanks for that but it dosent seem to be working, the worksheet has a level of protection on it to start with to prevent formulas being altered so only giving the user acess to certian cells. what I need to achive is when say cell K2 has the word Approved in it then the sheet unlocks and then re-locks but making all cells and object unselectable.. Not sure if that makes sense
-
Re: Locking worksheet
Ok, I think I understand now. This will unprotect the sheet when A1 is changed, lock all cell in the entire worksheet, and reprotect the sheet.
-
-
-
-
Re: Locking worksheet
Up to you. If you use that, you don't need the line:
Cells.Locked = True
because it doesn't matter if they're locked or not...the user can't do anything on the sheet as long as it's protected. And it looks like you figured that one out anyhow
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!