Last Updated Date
Sometimes you want to automatically add the Last Updated Date when values in a certain column are changed. You may follow the steps below to setup the required macro;
Assumption: You have a 'Status' field in Column B and want to record 'Last Updated Date' in Column C,
1. Right-click on the sheet tab at the bottom and choose View Code
2. Paste the code below in the right pane in the VB Editor window which opens up
Private Sub Worksheet_Change(ByVal Target As Range)
Set Rng = Application.Intersect(Range("B:B"), Range(Target.Address))
If Rng Is Nothing Then
' Do nothing
Else
Target.Offset(0, 1) = Format(Date, "dd-mmm-yyyy")
End If
End Sub
3. Close the Editor window
4. Save the workbook as xlsm (Macro Enabled)
5. Test it by updating cells in Column B.
Attachment | Size |
---|---|
Add Last Updated Date.xlsm | 14.17 KB |
»
- SheelooC's blog
- Login or register to post comments
- 3026 reads
Recent comments
5 years 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago