Create a module and enter the code below, enter any sheets you wish to omit in the array vWshs = Array("Sheet1", "Sheet3", "Sheet4")
sub Publish_PDF()
Dim wsh As Worksheet, vWshs
vWshs = Array("Sheet1", "Sheet3", "Sheet4")
For Each wsh In ActiveWorkbook.Worksheets
If IsError(Application.Match(wsh.Name, vWshs, 0)) Then
wsh.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Tmp\" & wsh.Name, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
End If
Next wsh
end sub
and in the workbook -- before close module add
Private Sub Workbook_BeforeClose(Cancel As Boolean)
call publish_PDF
end sub
Bookmarks