hamistasty
Board Regular
- Joined
- May 17, 2011
- Messages
- 208
I'm trying to figure out how to make a macro that once pressed saves a copy of the workbook in the same folder it currently exists in as it's name with "Version x" and the date on the end.
For example, it could originally be called:
Workbook.xlsm
And once the button was clicked it would be saved as a new copy as:
Workbook - Version 1.1 - 21.06.11.xlsm
and the next time it is clicked it would create a new file:
Workbook - Version 1.2 - 21.06.11.xlsm
I'll take a stab at how this would work:
If the filename does not have the string "Version" in it then it adds it's own string to the end starting at 1.0.
If the filename has the string "Version" in it then it figures out what number it is, ie. "1.14" and changes it to 1.15 then resaves it.
I'm not sure how the date system would work. I Guess it could look for the string in the format of xx.xx.xx and delete that and rename it to the current date. Or because it's always going to be "Version 1.xx - xx.xx.xx" it could delete everything right of the Version string and just insert the date in regardless.
I would appreciate any help with this!
For example, it could originally be called:
Workbook.xlsm
And once the button was clicked it would be saved as a new copy as:
Workbook - Version 1.1 - 21.06.11.xlsm
and the next time it is clicked it would create a new file:
Workbook - Version 1.2 - 21.06.11.xlsm
I'll take a stab at how this would work:
If the filename does not have the string "Version" in it then it adds it's own string to the end starting at 1.0.
If the filename has the string "Version" in it then it figures out what number it is, ie. "1.14" and changes it to 1.15 then resaves it.
I'm not sure how the date system would work. I Guess it could look for the string in the format of xx.xx.xx and delete that and rename it to the current date. Or because it's always going to be "Version 1.xx - xx.xx.xx" it could delete everything right of the Version string and just insert the date in regardless.
I would appreciate any help with this!
Last edited: