Do you want this to be the exact time that you made the last change to any cell in each worksheet in the workbook, the last time that you made any change to any cell in any worksheet in the workbook or the last time that the workbook was saved?
Do you want this to be the exact time that you made the last change to any cell in each worksheet in the workbook, the last time that you made any change to any cell in any worksheet in the workbook or the last time that the workbook was saved?
Assume that you want to store the date and time in cells B1 and B2 of the 'datetimelog' worksheet and set the formula in these cells to '=NOW()'
and the number format to 'dd/mm/yyyy' and 'hh:mm:ss' respectively.
Copy the folowing code to the ThisWorkbook code module.
VBA Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Worksheets("datetimelog").Range("B1:B2").Calculate
End Sub
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.