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

Popular posts from this blog

javascript - THREE.js reposition vertices for RingGeometry -

javascript - I need to update the text of a paragraph by inline edit -

assembly - What is the addressing mode for ld, add, and rjmp instructions? -