Hi, thanks for the reply. Below is a simplified screenshot of what I'm working with. Hopefully, it's a bit more clear with a picture.
In the example below, I'm looking for a VBA to print only rows 6-22 that have a value in column M. So using the below example, I only want to print up to row 16, with rows 17-22 collapsed (I'm not sure if that's the right word) and then continue printing the summary row below it (Rows 23 & 34) after the last row with data in it, in this case Row 16.
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P |
---|
| | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | |
MO | | | | | | | | | | | | | | | | |
MO | | | | | | | | | | | | | | | | |
MO | | | | | | | | | | | | | | | | |
MO | | | | | | | | | | | | | | | | |
MO | | | | | | | | | | | | | | | | |
MO | | | | | | | | | | | | | | | | |
MO | | | | | | | | | | | | | | | | |
MO | | | | | | | | | | | | | | | | |
MO | | | | | | | | | | | | | | | | |
MO | | | | | | | | | | | | | | | | |
MO | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | |
98.1% | | | | | | | | | | | | | | | | |
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="bgcolor: #D9E1F2, align: right"][/TD]
[TD="bgcolor: #D9E1F2, align: right"][/TD]
[TD="bgcolor: #D9E1F2"][/TD]
[TD="bgcolor: #D9E1F2, align: right"][/TD]
[TD="bgcolor: #D9E1F2"][/TD]
[TD="align: center"]2[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="bgcolor: #D9E1F2, align: right"][/TD]
[TD="bgcolor: #D9E1F2, align: right"][/TD]
[TD="bgcolor: #D9E1F2"] [/TD]
[TD="bgcolor: #D9E1F2, align: right"][/TD]
[TD="bgcolor: #D9E1F2"][/TD]
[TD="align: center"]3[/TD]
[TD="align: right"][/TD]
[TD="bgcolor: #9BC2E6, align: center"]L-101[/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"]L-102[/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #D9E1F2"]Lot Size:[/TD]
[TD="bgcolor: #FFFF00, align: center"]52,000[/TD]
[TD="bgcolor: #FFFF00, align: center"]52,000[/TD]
[TD="bgcolor: #D9E1F2, align: right"]Page:[/TD]
[TD="bgcolor: #FFFF00"]1[/TD]
[TD="align: center"]4[/TD]
[TD="bgcolor: #9BC2E6"]Customer[/TD]
[TD="bgcolor: #9BC2E6, align: center"]Box B [/TD]
[TD="bgcolor: #9BC2E6, align: center"]Box C[/TD]
[TD="bgcolor: #9BC2E6, align: center"]Box D[/TD]
[TD="bgcolor: #9BC2E6, align: center"]Box E[/TD]
[TD="bgcolor: #9BC2E6, align: center"]Box F[/TD]
[TD="bgcolor: #9BC2E6, align: center"]Box G[/TD]
[TD="bgcolor: #9BC2E6, align: center"]Box H[/TD]
[TD="bgcolor: #9BC2E6, align: center"]Box I[/TD]
[TD="bgcolor: #9BC2E6, align: center"]Box J[/TD]
[TD="bgcolor: #9BC2E6, align: center"]Box K[/TD]
[TD="bgcolor: #9BC2E6, align: center"]Box L[/TD]
[TD="bgcolor: #9BC2E6, align: center"]Total[/TD]
[TD="bgcolor: #9BC2E6, align: center"]Balance[/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="align: center"]5[/TD]
[TD="bgcolor: #9BC2E6, align: right"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"][/TD]
[TD="bgcolor: #9BC2E6, align: center"]By[/TD]
[TD="bgcolor: #9BC2E6, align: center"]Date[/TD]
[TD="align: center"]6[/TD]
[TD="bgcolor: #D9E1F2, align: center"]10[/TD]
[TD="bgcolor: #D9E1F2, align: center"][/TD]
[TD="bgcolor: #D9E1F2, align: center"][/TD]
[TD="bgcolor: #D9E1F2, align: center"][/TD]
[TD="bgcolor: #D9E1F2, align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]120[/TD]
[TD="align: center"]51,880[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]120[/TD]
[TD="align: center"]51,760[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]120[/TD]
[TD="align: center"]51,640[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]9[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]120[/TD]
[TD="align: center"]51,520[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]120[/TD]
[TD="align: center"]51,400[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]100[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]1,200[/TD]
[TD="align: center"]50,200[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]100[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]1,200[/TD]
[TD="align: center"]49,000[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]13[/TD]
[TD="align: center"]1,000[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]12,000[/TD]
[TD="align: center"]37,000[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]1,000[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]12,000[/TD]
[TD="align: center"]25,000[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]15[/TD]
[TD="align: center"]1,000[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]12,000[/TD]
[TD="align: center"]13,000[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]16[/TD]
[TD="align: center"]1,000[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]12,000[/TD]
[TD="align: center"]1,000[/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]17[/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]18[/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]19[/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]20[/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]21[/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]22[/TD]
[TD="align: right"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]23[/TD]
[TD="bgcolor: #B4C6E7, align: center"]TOTAL[/TD]
[TD="bgcolor: #B4C6E7, align: center"]51,000[/TD]
[TD="bgcolor: #B4C6E7, align: center"]0[/TD]
[TD="bgcolor: #B4C6E7, align: center"]0[/TD]
[TD="bgcolor: #B4C6E7, align: center"]0[/TD]
[TD="bgcolor: #B4C6E7, align: center"]0[/TD]
[TD="bgcolor: #B4C6E7, align: center"]0[/TD]
[TD="bgcolor: #B4C6E7, align: center"]0[/TD]
[TD="bgcolor: #B4C6E7, align: center"]0[/TD]
[TD="bgcolor: #B4C6E7, align: center"]0[/TD]
[TD="bgcolor: #B4C6E7, align: center"]0[/TD]
[TD="bgcolor: #B4C6E7, align: center"]0[/TD]
[TD="align: center"]51,000[/TD]
[TD="align: center"]1,000[/TD]
[TD="bgcolor: #B4C6E7, align: center"][/TD]
[TD="bgcolor: #B4C6E7, align: center"][/TD]
[TD="align: center"]24[/TD]
[TD="align: right"]Calculation of Yield:[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
</tbody>