I want to create a VBA script that would save a copy of the document every 5-10 minutes with a new name. The script would keep like 10-15 copies in the same folder, incrementing a number each time. If it reaches the max number of saves, it should delete the oldest one.
document.xlsx - Working copy. document_b1.xlsx - First backup, done after 5 minutes. document_b2.xlsx - Second backup, after 10 minutes.
And so on, and so on.
When this number at the end reaches 15, the script should rename the rest.
document_b15 - gets deleted. document_b14 -> document_b15 document_b13 -> document_b14 ... document_b1 - new copy.
What kind of function could do the steps required?
A short list the VBA would need:
- Incrementing a valuable
- Renaming files
- Deleting file
- Saving the current document as a new file
I'm aware that the Q belongs to Stackoverflow. Regarding the programming part.
But I want to use an existing solution, rather than learning VBA from scratch.
Is there a VBA that would do this for me?