Forum Discussion
Joseph Huisman
Oct 01, 2018Copper Contributor
Automatically adding the date/time to a cell when another cell is updated
I am trying to create a spreadsheet where when a specific cell is updated in anyway, the date/time stamp automatically updates in the cell right beneath the cell that was updated. I only need to have...
Jin_Tang
Jul 06, 2021Copper Contributor
Hi, I tried using this code, and the first code mentioned. However, it doesn't seem to be working for me. regardless of what i enter in A1/B1/C1/D1/E1, there seems to be no output in A2/B2/C2/D2/E2.
Is there any settings that i should enable before writing this vba?
Is there any settings that i should enable before writing this vba?
kovesp
Sep 04, 2021Copper Contributor
No VBA needed; and that would not work when the workbook is opened in the browser or mobile platforms.
If the column where you want to automatically set the current date is say B, the column where the data is being entered is say C, and you are starting from B1 then therre are two variants:
- If you want the date to update whenever the data is changed in column C, then place
=IF(ISBLANK(C1)," ",NOW())
in B1 and copy down. - If you want the date to be set only when the data in column C is changed from blank to a non-blank value (but not when the value is changed from non-black value to another non-blank value) then place
=IF(ISBLANK(C1)," ",IF(ISBLANK(B1)," ",NOW()))
in B1 and copy down.
These work when the workbook is opened from Windows or Android (so it probably also works on IOS, but I don't use that platform, so can't verify).
Note: There was a previous reply which was similar to the first option above, but used TODAY(). That won't work, because the TODAY() function updates whenever the workbook is opened. NOW() will not do that, it "freezes" the date when invoked.