Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 454
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 454
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display Date Modified debbieevans Excel Discussion (Misc queries) 5 February 12th 07 01:20 PM
Display last date workbook was modified? manxman Excel Discussion (Misc queries) 1 July 21st 06 07:25 AM
Display date modified Curious Excel Discussion (Misc queries) 2 July 13th 06 12:34 PM
How do I display the 'Date Modified' in an Excel worksheet header DC Solah Excel Discussion (Misc queries) 3 July 10th 06 06:03 PM
Display Date Modified Rich P Excel Discussion (Misc queries) 0 May 25th 06 04:32 PM


All times are GMT +1. The time now is 09:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"