Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
? 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
conditional formatting for cell date to equal today's date | Excel Worksheet Functions | |||
date in Cell to change colors if the date is beyond today's date | Excel Discussion (Misc queries) | |||
How to use Today's date in a cell and make it stay the same date | Excel Discussion (Misc queries) | |||
I need today's date returned as date format in formula | Excel Discussion (Misc queries) | |||
count the number of cells with a date <= today's date | New Users to Excel |