Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving date as part of filename
Hi all
I am using Excel 2000 and I want to assign a routine to a button that takes a name from one cell and a date from another and passes this to the Saveas routine. The idea is that I will end up with a copy of the original file that has a name such as MyFile070308.xls. However, when I try this the date gets re-formatted into the number of days since 01/01/1900. Any ideas? Chris |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving date as part of filename
Hi
If date is in A1 then try Dim myDate as string myDate = format(Datevalue(Range("A1")), "dd mmm yy") you can change the "dd mmm yy" bit as required (look at date formats in excel cell fomat options for syntax) regards Paul On Mar 7, 9:56*am, wrote: Hi all I am using Excel 2000 and I want to assign a routine to a button that takes a name from one cell and a date from another and passes this to the Saveas routine. *The idea is that I will end up with a copy of the original file that has a name such as MyFile070308.xls. However, when I try this the date gets re-formatted into the number of days since 01/01/1900. Any ideas? Chris |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Saving date as part of filename
On 7 Mar, 10:11, wrote:
Hi If date is in A1 then try Dim myDate as string myDate = format(Datevalue(Range("A1")), "dd mmm yy") you can change the "dd mmm yy" bit as required (look at date formats in excel cell fomat options for syntax) regards Paul On Mar 7, 9:56 am, wrote: Hi all I am using Excel 2000 and I want to assign a routine to a button that takes a name from one cell and a date from another and passes this to the Saveas routine. The idea is that I will end up with a copy of the original file that has a name such as MyFile070308.xls. However, when I try this the date gets re-formatted into the number of days since 01/01/1900. Any ideas? Chris Thanks Paul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Saving with Today's date as part of the string | Excel Programming | |||
Automatically saving an Excel spreadsheet with today's date in the filename | Excel Programming | |||
Saving with date in filename | Excel Programming | |||
Saving filename same as import filename | Excel Programming | |||
Get a part of a filename | Excel Programming |