A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Generate a file name by date....



 
 
Thread Tools Display Modes
  #1  
Old June 20th, 2009, 08:01 PM posted to microsoft.public.excel.misc
mlindsey54
external usenet poster
 
Posts: 4
Default Generate a file name by date....

What I'm trying to do is to name a file by date and then access that same
file the next day and use the data that's there for current date....

An example is:
All End-totals in file 06/21/09 will be Beginning-totals in currently
opened file that will be named the current date ( 06/22/09 ) at the end of
the day...

In a perfect world I'd like for this file to be automatically named and
saved. But if this can't be done I have no problem doing this my self...
  #2  
Old June 20th, 2009, 08:17 PM posted to microsoft.public.excel.misc
mlindsey54
external usenet poster
 
Posts: 4
Default Generate a file name by date....for excel 2007



"mlindsey54" wrote:

What I'm trying to do is to name a file by date and then access that same
file the next day and use the data that's there for current date....

An example is:
All End-totals in file 06/21/09 will be Beginning-totals in currently
opened file that will be named the current date ( 06/22/09 ) at the end of
the day...

In a perfect world I'd like for this file to be automatically named and
saved. But if this can't be done I have no problem doing this my self...

  #3  
Old June 20th, 2009, 08:23 PM posted to microsoft.public.excel.misc
Ron de Bruin
external usenet poster
 
Posts: 2,861
Default Generate a file name by date....for excel 2007

Use this in the filename string (you can remove the time)
Format(Now, "dd-mmm-yy h-mm-ss")

See how I use it here
http://www.rondebruin.nl/mail/folder1/mail2.htm



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"mlindsey54" wrote in message ...


"mlindsey54" wrote:

What I'm trying to do is to name a file by date and then access that same
file the next day and use the data that's there for current date....

An example is:
All End-totals in file 06/21/09 will be Beginning-totals in currently
opened file that will be named the current date ( 06/22/09 ) at the end of
the day...

In a perfect world I'd like for this file to be automatically named and
saved. But if this can't be done I have no problem doing this my self...

  #4  
Old June 21st, 2009, 04:58 PM posted to microsoft.public.excel.misc
Jacob Skaria
external usenet poster
 
Posts: 5,952
Default Generate a file name by date....

'To save as current date
ActiveWorkbook.SaveAs "c:\" & Format(Date, "dd-mm-yyyy") & ".xls"

'and for opening previous day's file
Workbooks.Open "c:\" & Format(Date - 1, "dd-mm-yyyy") & ".xls"

If this post helps click Yes
---------------
Jacob Skaria


"mlindsey54" wrote:

What I'm trying to do is to name a file by date and then access that same
file the next day and use the data that's there for current date....

An example is:
All End-totals in file 06/21/09 will be Beginning-totals in currently
opened file that will be named the current date ( 06/22/09 ) at the end of
the day...

In a perfect world I'd like for this file to be automatically named and
saved. But if this can't be done I have no problem doing this my self...

  #5  
Old June 23rd, 2009, 05:45 AM posted to microsoft.public.excel.misc
mlindsey54
external usenet poster
 
Posts: 4
Default Generate a file name by date....

I would like to do this in the workbook. I need to be able to acces the data
in yesterday's workbook from the current one thats being used and at the end
of the day when it is closed it will be save with today's date. There is info
in the work book that I want the current day's workbook to get from
yesterday's workbook. I'm having problems getting it to access the data from
the previous day like in the example I gave...how would I put it in there to
go get yesterdays end-totals.,
I can do it within the workbook from different pages but not from
yesterday's workbook...That's why I asked about how to generate a filename by
date..I also want to use current one to go back and get data from
yesterday's...I need this to be done automatically...Thanks for input and I
hope that you can help me out with this...

"Jacob Skaria" wrote:

'To save as current date
ActiveWorkbook.SaveAs "c:\" & Format(Date, "dd-mm-yyyy") & ".xls"

'and for opening previous day's file
Workbooks.Open "c:\" & Format(Date - 1, "dd-mm-yyyy") & ".xls"

If this post helps click Yes
---------------
Jacob Skaria


"mlindsey54" wrote:

What I'm trying to do is to name a file by date and then access that same
file the next day and use the data that's there for current date....

An example is:
All End-totals in file 06/21/09 will be Beginning-totals in currently
opened file that will be named the current date ( 06/22/09 ) at the end of
the day...

In a perfect world I'd like for this file to be automatically named and
saved. But if this can't be done I have no problem doing this my self...

  #6  
Old June 23rd, 2009, 05:49 AM posted to microsoft.public.excel.misc
mlindsey54
external usenet poster
 
Posts: 4
Default Generate a file name by date....for excel 2007

I would like to do this in the workbook. I need to be able to acces the data
in yesterday's workbook from the current one thats being used and at the end
of the day when it is closed it will be save with today's date. There is info
in the work book that I want the current day's workbook to get from
yesterday's workbook. I'm having problems getting it to access the data from
the previous day like in the example I gave...how would I put it in there to
go get yesterdays end-totals.,
I can do it within the workbook from different pages but not from
yesterday's workbook...That's why I asked about how to generate a filename by
date..I also want to use current one to go back and get data from
yesterday's...I need this to be done automatically...Thanks for input and I
hope that you can help me out with this...

"Ron de Bruin" wrote:

Use this in the filename string (you can remove the time)
Format(Now, "dd-mmm-yy h-mm-ss")

See how I use it here
http://www.rondebruin.nl/mail/folder1/mail2.htm



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"mlindsey54" wrote in message ...


"mlindsey54" wrote:

What I'm trying to do is to name a file by date and then access that same
file the next day and use the data that's there for current date....

An example is:
All End-totals in file 06/21/09 will be Beginning-totals in currently
opened file that will be named the current date ( 06/22/09 ) at the end of
the day...

In a perfect world I'd like for this file to be automatically named and
saved. But if this can't be done I have no problem doing this my self...


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:23 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.