Forum Discussion
Tanner_Ayers
Oct 18, 2022Copper Contributor
Time stamp when a cell is changed
Hello, I have an excel problem I am hoping someone can help with. Column A has 5 rows with a drop down list options 1,2, and 3. Column B has 5 corresponding rows with the function =IF(A1<>"",NOW(),""...
HansVogelaar
Oct 18, 2022MVP
If you're willing to use VBA, it is possible.
Right-click the worksheet tab and 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).
You'll have to allow macros when you open the workbook.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
If Not Intersect(Range("A1:A5"), Target) Is Nothing Then
Application.ScreenUpdating = False
Application.EnableEvents = False
For Each rng In Intersect(Range("A1:A5"), Target)
If rng.Value = "" Then
rng.Offset(0, 1).ClearContents
Else
rng.Offset(0, 1).Value = Now
End If
Next rng
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End SubTanner_Ayers
Oct 18, 2022Copper Contributor
This will work however I am trying to avoid VBA due to this document being worked on by multiple users with varying levels of excel knowledge. The document is auto saved and I am afraid of the macro breaking when other people are inputting into the document.
- HansVogelaarOct 18, 2022MVP
Unfortunately that means it is not possible to do what you want.