ExcelError
New Member
- Joined
- Apr 25, 2024
- Messages
- 3
- Office Version
- 365
- Platform
- Windows
Good morning,
I have a Print to PDF VBA that I've been using for years. It's quite simple. The tool prints the Print Areas I set in tabs to a PDF. It is a CTR / Invoice Workbook. There is an inconvenient step at the end of this requiring me to go into Adobe and delete all the Sheets with a $0 value in the specific CTR as it adds no value to be in the PDF. What I would like to do is upgrade this VBA to print ONLY the tabs to PDF on which the value of a cell (Example is Cell H2421), is Greater than 0.
Here is the VBA.
Sub PrintCTRBook()
'
' PrintCTRBook Macro
'
'
Sheets(Array("PNF Summary", "CTR Summary", "Software", "CTR1", "CTR2", "CTR3", "CTR4" _
, "CTR5", "CTR6", "CTR7", "CTR8", "CTR9", "CTR10", "CTR11", "CTR12", "CTR13", "CTR14", _
"CTR15", "CTR19", "CTR90", "CTR95", "CTR98", "CTR99")).Select
Sheets("PNF Summary").Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
End Sub
I have a Print to PDF VBA that I've been using for years. It's quite simple. The tool prints the Print Areas I set in tabs to a PDF. It is a CTR / Invoice Workbook. There is an inconvenient step at the end of this requiring me to go into Adobe and delete all the Sheets with a $0 value in the specific CTR as it adds no value to be in the PDF. What I would like to do is upgrade this VBA to print ONLY the tabs to PDF on which the value of a cell (Example is Cell H2421), is Greater than 0.
Here is the VBA.
Sub PrintCTRBook()
'
' PrintCTRBook Macro
'
'
Sheets(Array("PNF Summary", "CTR Summary", "Software", "CTR1", "CTR2", "CTR3", "CTR4" _
, "CTR5", "CTR6", "CTR7", "CTR8", "CTR9", "CTR10", "CTR11", "CTR12", "CTR13", "CTR14", _
"CTR15", "CTR19", "CTR90", "CTR95", "CTR98", "CTR99")).Select
Sheets("PNF Summary").Activate
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
End Sub