This will enter todays date in Cell D9 when a change is made to Cell C9
paste the supplied code into Private Sub Worksheet_Change(ByVal Target As Range) routine.
also set date format you prefer in cell D9 properties.
1) Open the VB editor
1) On the left pane window, double click the sheet where you need your code to run.
2) Now, at the top of the code window you will see... (General) with a drop down, and (Declarations) with a drop down.
3) Click the drop down by (General) and select Worksheet.
4) Clcik the drop down by (Declarations) and select change
it should automatically create
Private Sub Worksheet_Change(ByVal Target As Range)
End Sub
Code:If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub If Target.Address = "$C$9" Then Application.EnableEvents = False Range("D9").Value = Format(Date, "dd/mm/yy") 'Turn events back on Application.EnableEvents = True 'Allow run time errors again On Error GoTo 0 End If
Bookmarks