Excel Macro Save.As Date -
i have macro
takes master workbook & saves bunch of different copies different labels.
example of section 1 workbook:
range("e1:g1").select activecell.formular1c1 = "099 commercial" chdir "t:\accounting\aspen pre-payroll (shared)\_payroll emails" activewindow.view = xlnormalview activewindow.zoom = 50 activeworkbook.saveas filename:= _ "t:\accounting\aspen pre-payroll (shared)\_payroll emails\099 payroll bundle crew & exp.xlsx" _ , fileformat:=xlopenxmlworkbook, createbackup:=false
so label after macro saves looks 099 payroll bundle crew & exp
099 payroll bundle 08-23-2016 crew & exp
08-23-2016 being date located in specific cell =rc[-1]
however, usuals " & format(date, "mm-dd-yyyy") & " & " & format(now(), "mm-dd-yyyy") & "
not work & gives me compile error pop-up.
my knowledge macros limited appreciated!
try using application.text
(replacing 'now()' date)
activeworkbook.saveas filename:= _ "t:\accounting\aspen pre-payroll (shared)\_payroll emails\099 payroll bundle" & application.text(now(), "mm-dd-yyyy") & " crew & exp.xlsx" _ , fileformat:=xlopenxmlworkbook, createbackup:=false
Comments
Post a Comment