ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Save file with todays date ref#11235 (https://www.excelbanter.com/excel-worksheet-functions/218374-save-file-todays-date-ref-11235-a.html)

[email protected]

Save file with todays date ref#11235
 
Hello,

I need to save an excel file to the below directory with todays date
can anyone assist me in combining the two formulas.


Formulas to save file as todays date

ActiveWorkbook.SaveAs "Report" & Format(Now, "yyyymmdd") & ".xls"



This is the directory

Sub test3()
'
' test3 Macro
' Macro recorded 1/29/2009 by ME
'

'
ActiveWorkbook.SaveAs Filename:= _
"\\Wnccteav4\CCVOL4\MFC\SHARED\GSAM\Macro Database\Currency
Imbalance\Imbalance database\For 01.30.09.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub

Dave Peterson

Save file with todays date ref#11235
 
Option Explicit
Sub test3()
dim myFileName as string
Dim myPath as string

'make sure you include the last backslash!
myPath = "\\Wnccteav4\CCVOL4\MFC\SHARED\GSAM\Macro Database\" _
& "Currency Imbalance\Imbalance database\"

myFilename = "Report" & Format(date, "yyyymmdd") & ".xls"

ActiveWorkbook.SaveAs Filename:=myPath & myfilename, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

End Sub

wrote:

Hello,

I need to save an excel file to the below directory with todays date
can anyone assist me in combining the two formulas.

Formulas to save file as todays date

ActiveWorkbook.SaveAs "Report" & Format(Now, "yyyymmdd") & ".xls"

This is the directory

Sub test3()
'
' test3 Macro
' Macro recorded 1/29/2009 by ME
'

'
ActiveWorkbook.SaveAs Filename:= _
"\\Wnccteav4\CCVOL4\MFC\SHARED\GSAM\Macro Database\Currency
Imbalance\Imbalance database\For 01.30.09.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub


--

Dave Peterson

Paul C

Save file with todays date ref#11235
 
Construct your file name string first like this

FName="\\Wnccteav4\CCVOL4\MFC\SHARED\GSAM\Macro Database\Currency
Imbalance\Imbalance database\Report" & Format(Now, "yyyymmdd") & ".xls"

Then use it in the Save line

ActiveWorkbook.SaveAs Filename:= _
FName, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False


" wrote:

Hello,

I need to save an excel file to the below directory with todays date
can anyone assist me in combining the two formulas.


Formulas to save file as todays date

ActiveWorkbook.SaveAs "Report" & Format(Now, "yyyymmdd") & ".xls"



This is the directory

Sub test3()
'
' test3 Macro
' Macro recorded 1/29/2009 by ME
'

'
ActiveWorkbook.SaveAs Filename:= _
"\\Wnccteav4\CCVOL4\MFC\SHARED\GSAM\Macro Database\Currency
Imbalance\Imbalance database\For 01.30.09.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub



All times are GMT +1. The time now is 07:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com