View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
The Code Cage Team[_145_] The Code Cage Team[_145_] is offline
external usenet poster
 
Posts: 1
Default Date in the workbook name


A & S;438621 Wrote:
Hi
I am trying to input the date into the title of the my workbook. I
know that you can not have a / in the title of a workbook but you can
have a - so I could put the date in as 8-2-2009 for instance. So I am
wondering is anyone knows how to get a date value from a cell that
would look like 8/2/2009 and then take that date and put it in as the
title of a workbook, but have it formatted such that it would look
like 8-2-2009.

Also is there a way to just add a day to a date, so that I could name
the next workbook 8-3-2009.

ThanksHow about this:

Code:
--------------------
ThisWorkbook.SaveAs (ThisWorkbook.Name & " - " & Format(Sheets("Sheet1").Range("A1").Value, "dd-mm-yy") & ".xls")
--------------------


--
The Code Cage Team

Regards,
The Code Cage Team
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=121716