Thanks Michael, I was wondering about what that "V" myself,
hadn't occurred to that was supposed to be \ / etc.
I would put hyphens into the date so that they look like
ISO formatted dates.
"string_" & Format(Now(), "yyyy-mm-dd")
or something less obvious like
"c:\mybackup\B" & Format(Now(), "yyyy_mmdd")
spaces can be troublesome in filenamess.
As Bob was indicating but didn't give a reason, it is important to
place the year first so you can sort on filename. Same applies
to naming worksheets with a date so you can sort them
http://www.mvps.org/dmcritchie/excel...#sortallsheets
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages:
http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page:
http://www.mvps.org/dmcritchie/excel/search.htm
"Michael Bednarek" <mb at mbednarek dot com> wrote in message news:(E-Mail Removed)...
> On Thu, 29 Jan 2004 13:23:02 -0000, "Bob Phillips"
> <(E-Mail Removed)> wrote in
> microsoft.public.excel.misc:
>
> >Emily,
> >
> >Pretty easy
> >
> > ActiveWorkbook.SaveAs Filename:=sFilename & Format(Now,"yyyy mm dd
> >hh:mm:ss")
> >
> >Don't put \/?; etc in the date, it will error if you do.
> ^^^
>
> I think the list of invalid characters in filenames is
> \ / : * ? " " < > |
> so those colons you suggest fall under "etc" and wouldn't work.
>
> Not strictly on the topic of the OP, but: additionally, there are many
> other characters which might bite you if used in filenames:
> ` ! @ # $ % ^ & + ; ' ,
> and any umlaut, accented or Unicode characters.
>
> >"Emily" <(E-Mail Removed)> wrote in message
> >news:6c0e01c3e669$841d1980$(E-Mail Removed)...
> >> I have a spreadsheet that is modified several times a day
> >> and by several people.
> >> Is it possible to somehow insert the date and timestamp
> >> (perhaps with a macro?) into the filename?
> >> It is very difficult to get users to use
> >> abbreviations/version numbers etc to show when the last
> >> modified spreadsheet was used - many "forget".
> >> If there was a way that automatically put the date and
> >> time into the filename then users will know which is the
> >> most recent document to use - and not have any excuses!
> >> many thanks peeps!
>
> --
> Michael Bednarek http://mbednarek.com/ "POST NO BILLS"