
Tips.Net > ExcelTips Home > Editing > Noting When a Workbook was Changed
Summary: You may want to keep track of when changes were last made to a workbook, particularly if the workbook is accessible to multiple people who may change it. This tip discusses a couple of ways you can keep track of such information. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, and Excel 2003.)
In an environment where multiple people work on the same workbook, you may want a way to keep track of when people last changed a workbook. There are a couple of ways you can approach this task. One is to simply figure out when a workbook was last saved. This approach works well if you assume that any changes to the workbook are always changed. (Unsaved changes, of course, are not really a lasting change at all.) The following macro will return the date that a workbook was saved and store that date in cell A1:
Sub DateLastModified()
Dim fs, f
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile("D:\MyFolder\MyFile.xls")
Cells(1, 1) = f.DateLastModified
End Sub
To use the macro, just replace the D:\MyFolder\MyFile.xls file specification with whatever is appropriate for you.
If you want a history sheet of who did what with your workbook, then a different approach is necessary. Perhaps the best solution is to try Excel's sharing feature, which can be configured to keep a history log for a workbook. Follow these steps:
As changes are made to the workbook, Excel tracks those changes (along with who made them) and puts them in a separate worksheet so you can review them later.
Tip #2935 applies to Microsoft Excel versions: 97 2000 2002 2003
Got the Time? If you work with either times or dates in Excel, you really need ExcelTips: Times and Dates. Everything you need to know about slicing, dicing, and generally working with times and dates.
It doesn't matter if you are a beginner or expert, the ExcelTips archives are the fastest way to improve your productivity. (more information...)
Ask an Excel Question
Make a Comment
ExcelTips FAQ
ExcelTips Premium
Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Pet Tips
Word2007 Tips
WordTips
Advertise on the
ExcelTips Site