Forum Discussion
VBA coding help
- Mar 27, 2023
I've added the worksheet change event to your worksheet "Master Project List" for entries in range M6:M200. If i enter a value in any of these cells the current date and time is entered in the adjacent cell of column N.
One possible solution is to change the line
Target.Offset(1, 0) = Now
to
Target.Offset(0, 1) = Now
This will update the cell in column N that corresponds to the changed cell in column M, instead of the cell below it.
Another possible solution is to use the Worksheet_Calculate event instead of the Worksheet_Change event. This will update the cells in column N only when the values in column M are recalculated.
You can use a formula like this in column N:
=IF(M2<>"",Lastmodified(M2),"")
This will call the Lastmodified function only when the cell in column M is not empty.