Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I am trying to auto-set the current date in a cell when data is modified in a corresponding cell. The cell that the date is being inserted into is locked so it works great until I protect the sheet. Once the sheet is protected it will no longer enter the date into the locked cell. How can I modify the code below to allow it to enter the date even when the cell it is trying to enter it into is locked? "Private Sub Worksheet_Change(ByVal Target As Excel.Range) Dim R As Long R = Target.Row On Error GoTo ErrHandler Application.EnableEvents = True If Not Intersect(Range("L2:m20"), Target) Is Nothing Then Range("L2:M20").Sort Key1:=Range("L2") '<<== CHECK RANGE End If If Target.Column < 2 Then Exit Sub If Target.Row = 1 Then Exit Sub Target.Offset(0, 2).Value = Date ErrHandler: Application.EnableEvents = True End Sub " Thanks, Ben |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Locked Cell - can still edit | Excel Worksheet Functions | |||
Formula in Cell changes even if it's locked | Excel Discussion (Misc queries) | |||
run a macro in a locked cell | Excel Discussion (Misc queries) | |||
Locked out of Cell Formatting | Excel Discussion (Misc queries) | |||
Put comments on a locked spreadsheet even though cells not locked | Excel Worksheet Functions |