View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Print area based on item list

Hi Peter

You can loop like this to Hide_Print_Unhide or use AutoFilter
This example look in the cells Sheets("Sheet1").Range("A1:A30")

Sub Hide_Print_Unhide()
Dim cell As Range
Dim rng As Range

Application.ScreenUpdating = False

With Sheets("Sheet1")
Set rng = .Range("A1:A30")

For Each cell In rng
If .Cells(cell.Row, 1).Value = 0 Then _
.Rows(cell.Row).Hidden = True
Next cell
.PrintOut ' for testing use .PrintPreview
rng.EntireRow.Hidden = False
End With

Application.ScreenUpdating = True
End Sub



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


"Peter J" wrote in message ...
I have an item list on on my first work sheet and several other worksheets
with invoices based on the first worksheet. How can I get the invoices to
print but only print the item lines with a greater than zero quantity?
--
Peter J