I found code to work in Excel
that almost does what I need.
My need is to have today's date added automatically in one column's cell when a change is made in another column's cell. So if I click in Column M Row 20's cell & change data or add data (in this case it is a Status column with a dropdown list) then in Column N Row 20's cell it will put today's date or replace old date with today's date. (Every time Status dropdown is changed.)
This code does that for 2 different columns because I altered it.
The Problems:
If I insert rows it will put today's date in the newly inserted rows or if I delete rows, let's say 3 rows it will add the date or overwrite the date in the 3 rows below the 3 just deleted. This is not good. I only want a date added if I make a change in the cell itself. Simply auto add date when we add or change the status (Data) in the cell to the left of it.
Also I need the top 9 rows not to be affected by this auto date add.
Lastly if I double click in Column M Row 20's cell but do not enter any data then click out of the cell it will still add date to Column N Row 20's cell.
I found the original code at: Auto-fill the date in a cell, when the user enters information in an adjacent cell
My version of the code is:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range, M As Range, X As Range, Inte As Range, r As Range
Set A = Range("M:M,X:X")
Set Inte = Intersect(A, Target)
If Inte Is Nothing Then Exit Sub
Application.EnableEvents = False
For Each r In Inte
r.Offset(0, 1).Value = Date
Next r
Application.EnableEvents = True
End Sub