macro to not print blank value rows in invoice

D

Dave

I have an invoice in Excel for billing my customers with over 100 total items
that I carry in my full inventory
I might only use 25 or so per invoice.
Currently eliminate the blank rows manually so I don't have to print all items
would like a macro to automatically not print any row(item) that has no value
Any help would be appreciated.
 
R

Ron de Bruin

This example test if the whole row is empty.
It test row 1 -20 on the active sheet

Sub test()
Dim a As Long
For a = 1 To 20
If Application.WorksheetFunction.CountA(Rows(a)) = 0 Then _
Rows(a).Hidden = True
Next a
ActiveSheet.PrintPreview
Range("A1:A20").EntireRow.Hidden = False
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top