Re: not printing pages



Hide the rows you don't want printed.

Assumes you have formulas that return "" if no data available.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim c As Range
Dim rng As Range
Set rng = Range(Range("A1"), Cells(Rows.Count, 1).End(xlUp))
With rng
Do
Set c = .Find("", LookIn:=xlValues, lookat:=xlWhole, _
MatchCase:=False)
If c Is Nothing Then Exit Do
c.EntireRow.Hidden = True
Loop
End With
End Sub


Gord Dibben MS Excel MVP

On Wed, 13 Aug 2008 06:38:00 -0700, Barry <Barry@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:

I have a 15 page spread *** that is linked to another *** that fills in
the values, if there are no values for one of the 15 pages can I program
excel to not print the page(s) with no values?

.


Loading