Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Putting Data & Time in file name


I would like to add the time to the file name along with the date that I
currently have in the file name.

I currently have the date in the code below in bold. How can I add the
current time as well?

ActiveWorkbook.SaveAs Filename:="C:\SOS Data\Compiled Data\SOS Data - "
*& Format(Date, "mm-dd-yyyy") &* ".xls"

Thanks ya'll!!!


--
rglasunow
------------------------------------------------------------------------
rglasunow's Profile: http://www.excelforum.com/member.php...fo&userid=4212
View this thread: http://www.excelforum.com/showthread...hreadid=385436

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Putting Data & Time in file name

Try:

Format(Date, "mm-dd-yyyy hhmmss")

--
Damon Longworth

Don't miss out on the 2005 Excel User Conference
Sept 16th and 17th
Stockyards Hotel - Ft. Worth, Texas
www.ExcelUserConference.com


"rglasunow" wrote
in message ...

I would like to add the time to the file name along with the date that I
currently have in the file name.

I currently have the date in the code below in bold. How can I add the
current time as well?

ActiveWorkbook.SaveAs Filename:="C:\SOS Data\Compiled Data\SOS Data - "
*& Format(Date, "mm-dd-yyyy") &* ".xls"

Thanks ya'll!!!


--
rglasunow
------------------------------------------------------------------------
rglasunow's Profile:
http://www.excelforum.com/member.php...fo&userid=4212
View this thread: http://www.excelforum.com/showthread...hreadid=385436



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Putting Data & Time in file name


Unfortunately that did not work. The only thing it did was add 6 zero
after the date. I also tried hh:mm:ss and that didn't work either.
Any other suggestions in putting the current time into the file name?

thanks again

--
rglasuno
-----------------------------------------------------------------------
rglasunow's Profile: http://www.excelforum.com/member.php...nfo&userid=421
View this thread: http://www.excelforum.com/showthread.php?threadid=38543

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Putting Data & Time in file name


Instead of date use Now.

Code
-------------------

Format(Now, "mm-dd-yyyy hhmmss"
-------------------

--
Nori
-----------------------------------------------------------------------
Norie's Profile: http://www.excelforum.com/member.php...fo&userid=1936
View this thread: http://www.excelforum.com/showthread.php?threadid=38543

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
Putting consecutive time in cells mrmnz Excel Discussion (Misc queries) 3 October 22nd 08 08:44 PM
Putting Excel formatting and/or formulas into CSV file Frank D. Nicodem, Jr. Excel Discussion (Misc queries) 1 July 11th 05 10:18 PM
Putting a formula in place one time for the entire spreadsheet jacob Excel Programming 6 May 6th 05 03:39 PM
putting file name within spreadsheet bobf Excel Discussion (Misc queries) 3 April 1st 05 04:39 PM
putting date and time together in 1 cell Robbie Excel Discussion (Misc queries) 2 February 22nd 05 03:03 PM


All times are GMT +1. The time now is 03:42 PM.

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"