I have a simple macro command button with the following script:
Sub PrintVisibleOnly()
Dim wsh As Worksheet
For Each wsh In ActiveWorkbook.Worksheets
If wsh.Visible = xlSheetVisible Then
wsh.PrintOut
End If
Next wsh
End Sub
This macro automatically prints the selected print area of any visible tabs. I would like to amend it slightly (or add another command button) with a macro which will instead of printing out the sheets to the default printer, simply print to PDF. Is anyone aware of any code I can input here?
Sub PrintVisibleOnly()
Dim wsh As Worksheet
For Each wsh In ActiveWorkbook.Worksheets
If wsh.Visible = xlSheetVisible Then
wsh.PrintOut
End If
Next wsh
End Sub
This macro automatically prints the selected print area of any visible tabs. I would like to amend it slightly (or add another command button) with a macro which will instead of printing out the sheets to the default printer, simply print to PDF. Is anyone aware of any code I can input here?