PDA

View Full Version : Solved: Saving Sheet



vzachin
02-27-2007, 12:51 PM
Hi

How can I write a code to save a sheetname with today's date formatted ddmmyyyy?

I tried the following:

Range("A3").Formula = "=TODAY()"
Sheets("2").Name = Range("A3")



but it's giving me an error message because of the slashes in the dates.


thanks
zach

mvidas
02-27-2007, 01:01 PM
Hi Zach,

What about Sheets(2).Name = Format(Date, "ddmmyyyy")Matt

lucas
02-27-2007, 01:02 PM
Dim newFile As String, fName As String
' Don't use "/" in date, invalid syntax
newFile = Format$(Date, "m-d-yy")

vzachin
02-27-2007, 03:26 PM
hi Matt & Lucas,

both solutions work for me.

thanks again
zach