Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default encoding Today's date

I am trying to insert the current date into the name of a
file below is the code snippet I am working with.

ActiveWorkbook.SaveAs Filename:= _
"\\aussvprod\Marketing\Product Information\PM
Reports\1020 PM Reports\1020 Slater.xls" _

The 1020 represents the date 10/20, but it does not have
to be formatted, 1020.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default encoding Today's date

Pablo,

ActiveWorkbook.SaveAs Filename:= _
"\\aussvprod\Marketing\Product Information\PM
Reports\" & Month(Date) & Day (Date) & " PM Reports\1020 Slater.xls" _


--
sb
"Pablo" wrote in message
...
I am trying to insert the current date into the name of a
file below is the code snippet I am working with.

ActiveWorkbook.SaveAs Filename:= _
"\\aussvprod\Marketing\Product Information\PM
Reports\1020 PM Reports\1020 Slater.xls" _

The 1020 represents the date 10/20, but it does not have
to be formatted, 1020.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default encoding Today's date

Hi

It's done with

Format$(Date, "mmdd")

returning 1020 as a string for a little while longer. Like:

Dim sD As String
sD = Format$(Date, "mmdd")
ActiveWorkbook.SaveAs Filename:= _
"\\aussvprod\Marketing\Product Information\PM" & _
"Reports\" & sD & " PM Reports\" & sD & "Slater.xls"

In this case you are assuming that a properly named folder for today is present. If not,
or if only maybe or only probably, use MkDir function to create it before saving the file.

--
HTH. Best wishes Harald
Followup to newsgroup only please.

"Pablo" wrote in message
...
I am trying to insert the current date into the name of a
file below is the code snippet I am working with.

ActiveWorkbook.SaveAs Filename:= _
"\\aussvprod\Marketing\Product Information\PM
Reports\1020 PM Reports\1020 Slater.xls" _

The 1020 represents the date 10/20, but it does not have
to be formatted, 1020.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default encoding Today's date

? format(date,"mmdd")
1020

so:

sName = "\\aussvprod\Marketing\Product Information\PM Reports\"
sName = sName & format(date,"mmdd") & " PM Reports\"
sName = sName & format(date,"mmdd") & " Slater.xls"
ActiveWorkbook.SaveAs Filename:= sName


--
Regards,
Tom Ogilvy




"Pablo" wrote in message
...
I am trying to insert the current date into the name of a
file below is the code snippet I am working with.

ActiveWorkbook.SaveAs Filename:= _
"\\aussvprod\Marketing\Product Information\PM
Reports\1020 PM Reports\1020 Slater.xls" _

The 1020 represents the date 10/20, but it does not have
to be formatted, 1020.



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
conditional formatting for cell date to equal today's date Sistereinstein Excel Worksheet Functions 2 September 10th 12 07:53 PM
date in Cell to change colors if the date is beyond today's date Pete Elbert Excel Discussion (Misc queries) 2 June 6th 09 06:31 AM
How to use Today's date in a cell and make it stay the same date ADSK Excel Discussion (Misc queries) 6 November 17th 08 07:34 PM
I need today's date returned as date format in formula CMIConnie Excel Discussion (Misc queries) 2 February 23rd 06 04:38 PM
count the number of cells with a date <= today's date Cachod1 New Users to Excel 3 January 27th 06 09:14 PM


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