You can try the following VBA code.
Please do as this:
1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.
2. Then choose your used worksheet from the left Project Explorer, double click it to open the Module, and then copy and paste following VBA code into the blank Module:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim WorkRng As Range
Dim Rng As Range
Dim xOffsetColumn As Integer
Set WorkRng = Intersect(Application.ActiveSheet.Range(“B:B”), Target)
xOffsetColumn = 1
If Not WorkRng Is Nothing Then
Application.EnableEvents = False
For Each Rng In WorkRng
If Not VBA.IsEmpty(Rng.Value) Then
Rng.Offset(0, xOffsetColumn).Value = Now
Rng.Offset(0, xOffsetColumn).NumberFormat = “dd-mm-yyyy, hh:mm:ss”
Application.EnableEvents = True
3. Then save and close this code to return to the worksheet, now when you change the cell value or type new data in Column B, the date and time will be recorded automatically in Column C.
1. In the above code, you can modify the “B:B” to any other column that you want to change the cell values in this script: Set WorkRng = Intersect(Application.ActiveSheet.Range(“B:B”), Target).
2. With this xOffsetColumn = 1 script, you can insert and update the date and time to the first column next to your changing value column, you can change the number 1 to other numbers, such as 2,3,4,5…that means the date will be inserted the second, third, fourth or fifth column besides your changed values column.
3. When you delete a value in the changed column, the date and time will be removed as well.