Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This sheet event code will lock cells in columns B and C and enter the login
username in column C when data is entered in column B Note: first unlock all cells in columns B and C Private Sub Worksheet_Change(ByVal Target As Excel.Range) On Error GoTo enditall Application.EnableEvents = False If Target.Cells.Column = 2 Then ActiveSheet.Unprotect Password:="justme" If Target.Value < "" Then Target.Locked = True With Target.Offset(0, 1) .Value = Environ("Username") .Locked = True End With End If End If enditall: Application.EnableEvents = True ActiveSheet.Protect Password:="justme" End Sub To hide the code and password from prying eyes, lock the VBA Project from viewing. Gord Dibben MS Excel MVP On Mon, 20 Apr 2009 12:17:25 -0700, hugrl wrote: So Admin can edit & delete wrong data entered & who entered data "Dave Peterson" wrote: This sounds like a bad idea to me. How would you ever correct typing mistakes? hugrl wrote: set up spreadsheet for holidays but need to protect cells but allow a user to enter a number in a cell but not allow to remove once entered -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protect cells from other users w/out me having to enter pw | Excel Discussion (Misc queries) | |||
protect cells only after information is entered | Excel Discussion (Misc queries) | |||
How do I lock unclock cells to protect the data entered? | Excel Worksheet Functions | |||
i have a excell for with data entered in and need to enter new da. | Excel Worksheet Functions | |||
Protect data in cells after entered | Excel Discussion (Misc queries) |