excel - Open and Save a New Workbook as CSV file (delimited) -
excel - Open and Save a New Workbook as CSV file (delimited) -
i have workbook has 30 sheets. each sheet has it's own macro. then, sheet called "main page has macros. 1 of them merges sheets, creating new sheet combined. need macro when clicked, opens new workbook, copies info sheet "combined" , saves it's own workbook, , also, name "tracking import file (todays date) .csv" (delimited) can of except format of csv file not same when manually it. have macro doing sheet well, sheet gets saved normal workbook extension, working fine. code have right now:
set wb = workbooks.add thisworkbook.sheets("back order follow report").copy before:=wb.sheets(1) wb.saveas "s:\production department\backorder follow reports\back order follow report." & format(date, "mm.dd.yy") & ".xlsx" *set wb = workbooks.add thisworkbook.sheets("combined").copy before:=wb.sheets(1) wb.saveas "s:\production department\tracking import\tracking import filetest." & format(date, "mm.dd.yy") & ".csv"* end sub
there second, optional parameter on wb.saveas method tells excel format save file in. simply putting ".csv" @ end of file doesn't create csv, that's name. save csv use:
wb.saveas "s:\production department\tracking import\tracking import filetest." & format(date, "mm.dd.yy") & ".csv", xlcsv
excel excel-vba csv autosave
Comments
Post a Comment