Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Appending filename with date


I have a macro that runs an application, and creates new files with the
results. I want to have the date (and if possible time) of the run in
my file name. But I am not able to do this with the Date function as I
guess the results it throws is not in the text format. How can I do
this in VB? Right now, to do this, I am typing the date in "" in one of
the cellls, but I am sure there would be better ways. Suggestions
please.

Thanks,
Kapil


--
kapil.dalal
------------------------------------------------------------------------
kapil.dalal's Profile: http://www.excelforum.com/member.php...o&userid=23853
View this thread: http://www.excelforum.com/showthread...hreadid=375005

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Appending filename with date


Use in VBA

myVar = Format(Now(), "dd mmm yy")

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=375005

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Appending filename with date


sFilename = "myFile-" & Format(Now,"yyyymmdd hhmmss") & ".xls"

--
HTH

Bob Phillips

"kapil.dalal"
wrote in message
...

I have a macro that runs an application, and creates new files with the
results. I want to have the date (and if possible time) of the run in
my file name. But I am not able to do this with the Date function as I
guess the results it throws is not in the text format. How can I do
this in VB? Right now, to do this, I am typing the date in "" in one of
the cellls, but I am sure there would be better ways. Suggestions
please.

Thanks,
Kapil


--
kapil.dalal
------------------------------------------------------------------------
kapil.dalal's Profile:

http://www.excelforum.com/member.php...o&userid=23853
View this thread: http://www.excelforum.com/showthread...hreadid=375005



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Appending filename with date


Thanks a lot. It works.


--
kapil.dalal
------------------------------------------------------------------------
kapil.dalal's Profile: http://www.excelforum.com/member.php...o&userid=23853
View this thread: http://www.excelforum.com/showthread...hreadid=375005

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Appending filename with date


Thanks for the feedback

Manges

--
mangesh_yada
-----------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...fo&userid=1047
View this thread: http://www.excelforum.com/showthread.php?threadid=37500



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Appending filename with date

This link might give you some ideas:

http://www.bygsoftware.com/Excel/VBA/saving.htm

--
Andy Wiggins FCCA
www.BygSoftware.com
Excel, Access and VBA Consultancy
Home of Excel Save and Backup
-

"kapil.dalal"
wrote in message
...

I have a macro that runs an application, and creates new files with the
results. I want to have the date (and if possible time) of the run in
my file name. But I am not able to do this with the Date function as I
guess the results it throws is not in the text format. How can I do
this in VB? Right now, to do this, I am typing the date in "" in one of
the cellls, but I am sure there would be better ways. Suggestions
please.

Thanks,
Kapil


--
kapil.dalal
------------------------------------------------------------------------
kapil.dalal's Profile:

http://www.excelforum.com/member.php...o&userid=23853
View this thread: http://www.excelforum.com/showthread...hreadid=375005



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
Appending data from one WB to another WB by date: KR Setting up and Configuration of Excel 0 October 7th 08 03:54 AM
set filename to <filename-date on open bob engler Excel Worksheet Functions 2 July 13th 06 05:11 AM
date in filename JCanyoneer Excel Programming 1 April 5th 05 12:08 AM
Saving with date in filename Ben Allen Excel Programming 3 April 26th 04 09:05 AM
Save date in filename Mike Excel Programming 6 February 24th 04 02:12 PM


All times are GMT +1. The time now is 09:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"