Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Display a Date when a cell is Modified
I lifted the code below and tweaked from this NG via Gord Dibben (but
I've done something wrong as it doesn't do anything) I simply want the date/time that any value is entered/changed in D9:D144 to display in J24 Could anyone assist? Thanks Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range("D9:D144")) Is Nothing Then With Target If .Value < "" Then .Range("J24").Value = Format(Now, "dd mmm yyyy hh:mm:ss") End If End With End If ws_exit: Application.EnableEvents = True End Sub |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Display a Date when a cell is Modified
Hi,
And that is exactly what the code does so a couple of things to check a- 1. where have you put it? It's worksheet code so right click the sheet tab, view code and paste in in on the right. 2. Are macros enabled? 3. has some other coe disabled events? Mike "Sean" wrote: I lifted the code below and tweaked from this NG via Gord Dibben (but I've done something wrong as it doesn't do anything) I simply want the date/time that any value is entered/changed in D9:D144 to display in J24 Could anyone assist? Thanks Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range("D9:D144")) Is Nothing Then With Target If .Value < "" Then .Range("J24").Value = Format(Now, "dd mmm yyyy hh:mm:ss") End If End With End If ws_exit: Application.EnableEvents = True End Sub |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Display a Date when a cell is Modified
Thanks Mike
I've changed to below and it works. Only issue now is that I have the sheet protected (except for D9:D144) but it doesn't seem to work when protected Private Sub Worksheet_Change(ByVal Target As Excel.Range) ActiveSheet.Unprotect Password:="1234" With Target If .Count 1 Then Exit Sub If Not Intersect(Range("D9:D144"), .Cells) Is Nothing Then Application.EnableEvents = False With Me.Cells(24, 10) .NumberFormat = "dd-mmm-yy at h:mm" .Value = Now End With ActiveSheet.Protect Password:="1234" Application.EnableEvents = True End If End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Display Date Modified | Excel Discussion (Misc queries) | |||
Display last date workbook was modified? | Excel Discussion (Misc queries) | |||
Display date modified | Excel Discussion (Misc queries) | |||
How do I display the 'Date Modified' in an Excel worksheet header | Excel Discussion (Misc queries) | |||
Display Date Modified | Excel Discussion (Misc queries) |