Excel Sheet Pdf Macro. The data structure i prepared for this example is very simple, a defined table with employees information in one sheet, and in another sheet. Tags attachment body choice pdf send y.
The code is written to save your document in the same folder as the excel file currently resides. Here are the steps to create the macro button: That i got a single pdf file with both sheets.
_ & vbcrlf & vbcrlf & press ok to exit this macro., vbcritical, unable to delete file exit sub end if end if set xusedrng = xsht.usedrange if application.worksheetfunction.counta(xusedrng.cells) <> 0 then 'save as pdf file xsht.exportasfixedformat type:=xltypepdf, filename:=xfolder, quality:=xlqualitystandard 'create outlook email set.
However, as i explain further above, the exportasfixedformat method has 9 parameters that allow you to further specify how visual basic for applications carries out the conversion from excel to pdf. Copy the code to a regular code module, then select the sheet(s) you want to export, and run the macro. However, as i explain further above, the exportasfixedformat method has 9 parameters that allow you to further specify how visual basic for applications carries out the conversion from excel to pdf. What is an excel macro?