ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   macro to not print blank value rows in invoice (https://www.excelbanter.com/excel-worksheet-functions/5610-macro-not-print-blank-value-rows-invoice.html)

Dave

macro to not print blank value rows in invoice
 
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.

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


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dave" wrote in message ...
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.





All times are GMT +1. The time now is 06:09 PM.

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