Excel VBA to Save Selected Sheets in Combination as PDFs -
Excel VBA to Save Selected Sheets in Combination as PDFs -
i have workbook many worksheets. save two-page pdfs, first page worksheet 1, , sec page worksheets 2-x. code allows me save individual pdfs each worksheet in workbook. wondering add together create this. can share advice?
thanks!
option explicit sub createpdffiles() dim ws worksheet dim fname string each ws in activeworkbook.worksheets on error resume next fname = "c:\folder\" & ws.name & "report" & format(date, "yyyy-mm-dd") & ".pdf" ws.exportasfixedformat _ type:=xltypepdf, _ filename:=fname, _ quality:=xlqualitystandard, _ includedocproperties:=true, _ ignoreprintareas:=false next ws end sub
you enumerating through worksheets , doing save within loop. why getting 1 pdf per worksheet. seek using workbook instead of activeworkbook.worksheets.
excel vba pdf worksheet
Comments
Post a Comment