Welcome to the Excel Forum

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.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 07-07-2005, 08:21 PM
rglasunow rglasunow is offline
Registered User
 
Join Date: 24 Dec 2003
Posts: 15
rglasunow is becoming part of the community
Putting Data & Time in file name

Please Register to Remove these Ads

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!!!
Reply With Quote
  #2  
Old 07-07-2005, 10:05 PM
Damon Longworth
Guest
 
Posts: n/a
Re: 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" <rglasunow.1rtqmy_1120781133.2984@excelforum-nospam.com> wrote
in message news:rglasunow.1rtqmy_1120781133.2984@excelforum-nospam.com...
>
> 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
>



Reply With Quote
  #3  
Old 07-08-2005, 03:37 PM
rglasunow rglasunow is offline
Registered User
 
Join Date: 24 Dec 2003
Posts: 15
rglasunow is becoming part of the community
Unfortunately that did not work. The only thing it did was add 6 zeros 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!
Reply With Quote
  #4  
Old 07-08-2005, 03:51 PM
Norie Norie is offline
Valued Forum Contributor
 
Join Date: 02 Feb 2005
Posts: 480
Norie is becoming part of the community
Instead of date use Now.
Code:
Format(Now, "mm-dd-yyyy hhmmss")
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump