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!

edit: error gives when try run macro

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

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -