ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Print Only Columns with Sum() in Row 43 <0 (https://www.excelbanter.com/excel-programming/275699-re-print-only-columns-sum-row-43-0-a.html)

Ron de Bruin

Print Only Columns with Sum() in Row 43 <0
 
Try this
It will hide, Print and unhide

Sub test()
Dim cell As Range
Application.ScreenUpdating = False
With ActiveSheet
For Each cell In .Range("C43:AZ43")
If cell.Value = 0 Then cell.EntireColumn.Hidden = True
Next
.PrintOut
.Range("C43:AZ43").Columns.Hidden = False
End With
Application.ScreenUpdating = True
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"JMay" wrote in message news:V324b.32396$xf.15803@lakeread06...
I have sheet templates 50 columns wide - Often times
when completed 15 or 20 columns are all $0.00 and my
Total (row 43) has =Sum(X10:X42) = $0.00
In my Workbook_BeforePrint what code would I enter to
test and Hide all columns from printing where the row 43's
(Columns C - AZ) Sum() = $0.00?
TIA...






All times are GMT +1. The time now is 09:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com