Forum Discussion
Automatically adding the date/time to a cell when another cell is updated
With the permission of everyone, here is another solution without VBA.
Simply with a formula.
=IF(C1="","",TODAY()) in english
=WENN(C1="";"";HEUTE()) in German
Info in the inserted file.
Thank you for your understanding and patience
Nikolino
I know I don't know anything (Socrates)
- Erin_OC_DirectFeb 06, 2024Copper Contributor
NikolinoDE This works, but unfortunately it then changes the date and time for all the cells whenever the date and time changes. So it doesn't exactly work as an accurate way to show that a cell was filled on THIS DATE and THIS TIME, because, it continues to update.
See, in the image below, I entered text in C3 at 9:13, but as I added text to successive rows at 9:15, all the times changed to 9:15.
I am glad to have had this practice, though, so thank you for the tip. I am wondering if you or anyone else has a way to do what I am looking for in this "easy" way.
- Erin_OC_DirectFeb 06, 2024Copper ContributorI found a solution on YouTube!
https://www.youtube.com/watch?v=YEyggg2z04c
Steps:
File> Options > Formulas [tab] > check "Enable iterative calculation" then change Maximum Iterations to "1"
Then use this formula for the cell where you want the time or date stamp:
=IF(C5<>"", IF(B5="", NOW(), B5), "")
* C5 would be the cell in which the date/time will appear, B5 represents the referenced cell. So in this example, when data is entered into B5, the time/date of entry will appear in C5.- CharityTJan 08, 2026Copper Contributor
After the step of "Enable iterative calculation" in options, this formula didn't work for me since it seems backwards from what was being asked.
This formula:
=IF(A2<>"",IF(B2="",NOW(),B2),"")
puts the time into B2 when data is entered into A2, if putting the time next to the data.To put the date below the data would require:
=IF(D6<>"", IF(D7="", NOW(), D7), "")I also had to save the file as a macro-enabled excel file (.xlsm) for it to not change the date for all the cells that I copied the first formula into. Before I did that, if I copied the formula in B2 into cells B3:B200, if I put data into any of the cells A2:A200, it would change all the times in cells B2:B200 to the same current time. But once I saved the file as a .xlsm, the time entered in B2 based on data in A2 did not change when I entered data into A3 or A4, etc.
- iamirenemaeDec 04, 2023Copper Contributor
it doesnt work becuase if you will open the file the next day, the cell will show the present date even though you updated it yesterday. NikolinoDE
- NikolinoDEDec 05, 2023Platinum Contributor
If you want the timestamp to be static and not update every day, you can use a combination of VBA (Visual Basic for Applications) and a worksheet event. The VBA code will be triggered whenever the specified cells are changed, and it will insert a timestamp in the cell below the updated cell.
Here's a step-by-step guide:
- Press Alt + F11 to open the Visual Basic for Applications editor.
- In the editor, right-click on VBAProject (Your Workbook Name) in the left pane.
- Choose Insert -> Module to insert a new module.
- Copy and paste the following VBA code into the module:
Vba code:
Private Sub Worksheet_Change(ByVal Target As Range) Dim ws As Worksheet Set ws = ThisWorkbook.Worksheets("Sheet1") ' Replace "Sheet1" with your sheet name Dim updatedCell As Range Set updatedCell = Intersect(Target, ws.Range("A1:E1")) ' Adjust the range as needed If Not updatedCell Is Nothing Then Application.EnableEvents = False updatedCell.Offset(1, 0).Value = Now Application.EnableEvents = True End If End Sub5. Close the VBA editor.
Make sure to replace "Sheet1" with the actual name of your sheet, and adjust the range in the Intersect function to match the range of cells you want to monitor.
Now, whenever any cell in the specified range is updated, the cell below it will be populated with the current date and time. The timestamp will not automatically update daily; it will remain static once entered.
- CJuddJan 12, 2026Copper Contributor
Sorry to dig this things' grave, but it's just too useful for me right now.
I used this script, and it works as advertised, but I am having an issue when it interacts with another script I am using in the same workbook, but on a different sheet.
So my first bit of code (shown below) takes a row of date and moves it to the second sheet when I check the Closed box. I was hoping that it would move it to the second sheet, and your code would update the date when that happens. Unfortunately, it does not seem to recognize the event. Do you know of a way I could change your code here to recognized that event?
I did have to change your code to put the date in the cell to the right, simply changing the cell offset from (1, 0) to (0, 1), but that's the only code bit I changed.
First code to move rows to second sheet:
Private Sub Worksheet_Change(ByVal Target As Range) Dim rngWatch As Range Dim rngChange As Range Dim c As Range Dim wsDest As Worksheet Dim rngDelete As Range 'What column(s) are you monitoring for change? Set rngWatch = Range("C3:C300") 'Where are we moving data to? Set wsDest = ThisWorkbook.Worksheets("Closed") 'Did you change a cell of interest? Set rngChange = Intersect(rngWatch, Target) If rngChange Is Nothing Then Exit Sub 'Prevent recursive calls and screen flicker Application.ScreenUpdating = False Application.EnableEvents = False For Each c In rngChange If UCase(c.Value) = "TRUE" Then 'Save this spot to clear later If rngDelete Is Nothing Then Set rngDelete = c Else Set rngDelete = Union(rngDelete, c) End If 'Move the row With wsDest c.EntireRow.Copy Destination:=.Cells(.Rows.Count, "A").End(xlUp).Offset(1) End With End If Next c 'Remove the blank rows If Not rngDelete Is Nothing Then rngDelete.EntireRow.Delete End If 'Reset Application.ScreenUpdating = True Application.EnableEvents = True End Sub
- NikolinoDEApr 15, 2021Platinum ContributorPlease don't forget to change the date format of the cells
- Carly_ForresterApr 20, 2021Copper ContributorHi there, I'm looking to have a column that updates whenever any cell in that row is updated. I'm just having trouble coming up with a formula. Could you help?
Thanks!!!- NikolinoDEApr 20, 2021Platinum Contributor
I cannot follow your flow of thoughts.
Please attach a file (without sensitive data) and on the basis of this you explain your plan in detail.
It makes no sense that we are constantly producing files that are not what you imagine.It is good to read this information in advance:
Welcome to your Excel discussion space!
Thank you for your patience and understandingNikolino