Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving with Today's date as part of the string The Hawk Excel Programming 3 August 13th 05 04:54 AM
Automatically saving an Excel spreadsheet with today's date in the filename Ian M Excel Programming 2 April 30th 04 01:09 AM
Saving with date in filename Ben Allen Excel Programming 3 April 26th 04 09:05 AM
Saving filename same as import filename Matt Excel Programming 4 February 24th 04 03:01 PM
Get a part of a filename Peter Pantus Excel Programming 2 November 7th 03 07:33 PM


All times are GMT +1. The time now is 11:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"