- Copy this code.
2) Right-Click the sheet tab of interest.
3) Select "View Code"
4) Paste the code into the window that appears.
5) Save the file as a macro-enabled .xlsm file.
6) Make changes as needed
Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
'If only one cell at a time should be changed, un-comment the next line
'If Target.Cells.Count > 1 Then Exit Sub
'To allow deletions to be bypassed without running the code, un-comment the next line
If Target.Value = "" Then Exit Sub
'To apply to a specific range on the sheet, uncomment the last of these 3 lines
'and change the range address to the range of interest
'If Intersect(Target, Range("A2:A10")) Is Nothing Then Exit Sub 'specific range
'Turn off events to keep out of loops
Application.EnableEvents = False
For Each c In Target
If c.Value <> "" Then
c(1, 2).NumberFormat = "m/d/y"
c(1, 2).Value = Date
End If
Next c
'Turn events back on to get ready for the next change
Application.EnableEvents = True
End Sub