17. VBA Tips - Save A Copy Of A File Daily

Nick's picture

Often during your working environment, you will need to track the history of a spreadsheet.

  • This tip will teach you how to seemlessly create a daily backup of your file
  • The file will be date stamped so that you can sort by date and easily find a file you're looking for when you need

Here's a screen shot of our VBA code:



  1. Assign a button to the SaveMeDaily sub routine
  2. myDateStamp is then set equal to the date in "yyyymmdd" format
    • So for today, that would be:  20090512
  3. The advantage of this is that you can sort by name in a browser
  4. FilePath is then constructed as thisworkbook's path + the date stamp
  5. We then use SaveCopyAs to save a copy as 20090512.xls

Download sheet to practise how to Save A Copy Of A File Daily in Excel

Training Video on how to Save A Copy Of A File Daily in Excel:

save-a-copy-of-a-file-daily.xls35.5 KB