Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Date in the workbook name

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.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 915
Default Date in the workbook name

A & S 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.

Thanks



In general you can format the date in a cell like this
Format(Range("A1"), "m-d-yyyy")

or this
Format(Range("A1") + 1, "m-d-yyyy")
  #3   Report Post  
Posted to microsoft.public.excel.programming
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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Date in the workbook name

On Aug 1, 6:00*pm, smartin wrote:
A & S 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.


Thanks


In general you can format the date in a cell like this
* *Format(Range("A1"), "m-d-yyyy")

or this
* *Format(Range("A1") + 1, "m-d-yyyy")


Everytime that I try to use this expression it gives me the error
"Expected ="

Thanks
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Date in the workbook name


How are you using it? it should be used like this in VBA
Code:
--------------------
ThisWorkbook.SaveAs (ThisWorkbook.Name & " - " & Format(Sheets("Sheet1").Range("A1").Value, "dd-mm-yy") & ".xls")
--------------------


A & S;438636 Wrote:
On Aug 1, 6:00*pm, smartin wrote:
A & S 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.


Thanks


In general you can format the date in a cell like this
* *Format(Range("A1"), "m-d-yyyy")

or this
* *Format(Range("A1") + 1, "m-d-yyyy")


Everytime that I try to use this expression it gives me the error
"Expected ="

Thanks



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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 915
Default Date in the workbook name

A & S wrote:
On Aug 1, 6:00 pm, smartin wrote:
A & S 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.
Thanks

In general you can format the date in a cell like this
Format(Range("A1"), "m-d-yyyy")

or this
Format(Range("A1") + 1, "m-d-yyyy")


Everytime that I try to use this expression it gives me the error
"Expected ="

Thanks


Sorry, my wording there was terrible. I should have said,

In general, you can format a date from a cell as a string in VBA like
this...

Then you can use that formatted string to save your worksheet. The Code
Cage Team has you covered.
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Date in the workbook name

Hello,

Assume in A1 you have 8/12/2009
Then:
Concatenate(month(a1),"-",day(a1),"-",year(a1))

Gabor
"A & S" wrote in message ...
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.

Thanks

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
RETRIEVE DATA FROM ANOTHER WORKBOOK BY CHECKING ON WORKBOOK DATE Joe Excel Worksheet Functions 13 May 27th 08 01:52 AM
date form and workbook with autofill for date ll Excel Programming 2 September 5th 07 08:42 PM
Workbook Date REM Setting up and Configuration of Excel 7 November 16th 06 03:02 PM
Workbook Create Date fx clowns Excel Worksheet Functions 0 July 18th 06 10:05 PM
Workbook date order Monty New Users to Excel 1 September 30th 05 06:48 PM


All times are GMT +1. The time now is 10:54 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"