Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date as filename
Hi there,
I am trying to include a a date that is referenced in a cell in my workbooks filename. The macro crashes each time because it says it cannot include" / " in the filename. I have tried to change the format of the cell, the macro still takes the date as 22/07/09. Please can someone suggest how i can take the date listed in the cell, remove the "/" and include it in the filename? Thanks for all the help that this forum has provided already, I really appreciate it. Regards, PVANS |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date as filename
With the date in cell A1; try
strFile = Format(Range("A1"),"dd-mm-yyyy") Then use this variable to SaveAs.. If this post helps click Yes --------------- Jacob Skaria "PVANS" wrote: Hi there, I am trying to include a a date that is referenced in a cell in my workbooks filename. The macro crashes each time because it says it cannot include" / " in the filename. I have tried to change the format of the cell, the macro still takes the date as 22/07/09. Please can someone suggest how i can take the date listed in the cell, remove the "/" and include it in the filename? Thanks for all the help that this forum has provided already, I really appreciate it. Regards, PVANS |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date as filename
dim strDate as string
strDate = format(range("A1").value,"dd.mm.yyyy") then use strDate in your filename "PVANS" wrote: Hi there, I am trying to include a a date that is referenced in a cell in my workbooks filename. The macro crashes each time because it says it cannot include" / " in the filename. I have tried to change the format of the cell, the macro still takes the date as 22/07/09. Please can someone suggest how i can take the date listed in the cell, remove the "/" and include it in the filename? Thanks for all the help that this forum has provided already, I really appreciate it. Regards, PVANS |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date as filename
Sorry, just to clarify... I am running a macro that saves the workbook
automatically. I am using the following code in the macro: ActiveSheet.Copy ActiveWorkbook.SaveAs "c:\temp\" & Range("H7") "PVANS" wrote: Hi there, I am trying to include a a date that is referenced in a cell in my workbooks filename. The macro crashes each time because it says it cannot include" / " in the filename. I have tried to change the format of the cell, the macro still takes the date as 22/07/09. Please can someone suggest how i can take the date listed in the cell, remove the "/" and include it in the filename? Thanks for all the help that this forum has provided already, I really appreciate it. Regards, PVANS |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date as filename
To Sam and Jacob,
It works beautifully. Thank you so much You guys really have been such a great help. Thank you! Regards, PVANS "Jacob Skaria" wrote: With the date in cell A1; try strFile = Format(Range("A1"),"dd-mm-yyyy") Then use this variable to SaveAs.. If this post helps click Yes --------------- Jacob Skaria "PVANS" wrote: Hi there, I am trying to include a a date that is referenced in a cell in my workbooks filename. The macro crashes each time because it says it cannot include" / " in the filename. I have tried to change the format of the cell, the macro still takes the date as 22/07/09. Please can someone suggest how i can take the date listed in the cell, remove the "/" and include it in the filename? Thanks for all the help that this forum has provided already, I really appreciate it. Regards, PVANS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Date into filename noe I need time also | Excel Programming | |||
set filename to <filename-date on open | Excel Worksheet Functions | |||
set excel <filename to <filename-date | Excel Programming | |||
date in filename | Excel Programming | |||
Filename with date and time | Excel Programming |