![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: May 2002
Posts: 66
|
Right, hopefully this is a straightforward one!
To cut a long story short, i need to automate the saving on an Excel workbook to add a cell value into the file name. For example...the file saves itself as "myfile.xls"...this is fine. However, the same file will contain different data values every week, so i need a "Week commencing" cell value or date code added automatically to the filename. For example, one week it will be myfile15-4-02.xls, the next week it will be myfile22-4-02.xls Can this be done? Many thanks |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
|
Would something like this be useful for you (use in a standard module, or even in the Workbook BeforeClose module): -
ChDir "C:My Documents" ThisWorkbook.SaveAs Format(Date, "dd-mm-yy") Rather than using the ChDir command you could build up the FileName from a string used for the path, and just concatenate the various bits together. HTH. |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: May 2002
Posts: 66
|
Mudface,
Busy day so far! I have yet to try this idea, but many thanks in advance for taking a look! I will let you know how i get on. G |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|