View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove[_2_] Harlan Grove[_2_] is offline
external usenet poster
 
Posts: 1,231
Default Help on VBA code

Maeglin wrote...
....
timestamp in just one cell, say A4, when an entry is made to any of the cells
in range A4:z500. Based on mcgimpsey's code, how do I change it to have it

....

If you want a timestamp in cell A4, and the entry range includes A4,
what happens when an entry is made in A4? I'll assume the entry range
is actually A5:Z100.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If Not Intersect(Range("A5:Z100"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
Range("A4").ClearContents
Else
Range("A4").NumberFormat = "dd mmm yyyy hh:mm:ss"
Range("A4").Value = Now
End If
Application.EnableEvents = True
End If
End With
End Sub