Forum Discussion
mister_hayman
Oct 05, 2023Copper Contributor
column last modified formula
So I have a spreadsheet and whenever column G is updated I would like to put a date timestamp in column P.
HansVogelaar
MVP
- Right-click the sheet tab.
- Select 'View Code' from the context menu.
- Copy the code listed below into the worksheet module.
- Switch back to Excel.
- Save the workbook as a macro-enabled workbook (*.xlsm).
- Make sure that you allow macros when you open the workbook.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("G2:G" & Rows.Count), Target) Is Nothing Then
Application.ScreenUpdating = False
Application.EnableEvents = False
Intersect(Range("G2:G" & Rows.Count), Target).Offset(0, 9).Value = Date ' or Now
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub
mister_hayman
Oct 05, 2023Copper Contributor
I don't recognise that end GUI apologies,,,,
- HansVogelaarOct 05, 2023MVP
Sorry, what do you mean by that?
- mister_haymanOct 05, 2023Copper ContributorThe black Powershell looking screencap
- HansVogelaarOct 05, 2023MVP
It is VBA code. You can copy it into the worksheet module - my previous reply describes in detail what to do.