Saving date as part of filename

  • Thread starter Thread starter chris
  • Start date Start date
C

chris

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
 
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
 
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

Thanks Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top