Hello Clay,
The attached workbook has a button on the "Cost Codes" sheet to print out the non zero totals. Each row is added to the worksheet "Printout Data" to build the printable data in contiguous rows. You will probably need to adjust your margins on the "Printout Data" sheet. Let me know if this is what you want.
Sub PrintData()
Dim Cell As Range
Dim DstWks As Worksheet
Dim NextRow As Long
Dim Rng As Range
Dim RngEnd As Range
Dim SrcWks As Worksheet
Set SrcWks = Worksheets("Cost Codes")
Set DstWks = Worksheets("Printout Data")
Set Rng = SrcWks.Range("B6")
Set RngEnd = SrcWks.Cells(Rows.Count, Rng.Column).End(xlUp)
Set Rng = IIf(RngEnd.Row < Rng.Row, Rng, SrcWks.Range(Rng, RngEnd))
Set Rng = Rng.Resize(ColumnSize:=8)
DstWks.UsedRange.Clear
For Each Cell In Rng.Columns(7).Cells
If Val(Cell.Value) > 0 Or Val(Cell.Offset(0, 1)) > 0 Then
NextRow = NextRow + 1
Rng.Rows(Cell.Row - Rng.Row + 1).Copy
DstWks.Cells(NextRow, "A").PasteSpecial Paste:=xlPasteValues
DstWks.Cells(NextRow, "A").PasteSpecial Paste:=xlPasteFormats
End If
Next Cell
DstWks.UsedRange.Columns.AutoFit
DstWks.PrintOut
End Sub
Bookmarks