![]() |
Macro to auto save file using the format YYMM
Hi,
I recorded a macro that automatically saves a file then change the formula in cell A1 to today's date, ie =today(), then save the file. I have a problem with the last part...is there any way I can set the macro such that the file will be saved as "c:\YYMM ABC" where 'YYMM' is the format of the date (probably can be taken from cell A1) and 'ABC' is my own file name? Thanks! |
You can get the date right in the code:
dim myFileName as string myfilename = "C:\" & format(date,"yymm") & " ABC.xls" activeworkbook.saveas filename:=myfilename, fileformat:=xlworkbooknormal Dolphinv4 wrote: Hi, I recorded a macro that automatically saves a file then change the formula in cell A1 to today's date, ie =today(), then save the file. I have a problem with the last part...is there any way I can set the macro such that the file will be saved as "c:\YYMM ABC" where 'YYMM' is the format of the date (probably can be taken from cell A1) and 'ABC' is my own file name? Thanks! -- Dave Peterson |
All times are GMT +1. The time now is 04:55 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com