(Msg. 1) Posted: Wed Aug 13, 2008 6:38 am
Post subject: not printing pages Archived from groups: microsoft>public>excel>printing (more info?)
I have a 15 page spread sheet that is linked to another sheet 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?
(Msg. 2) Posted: Wed Aug 13, 2008 2:49 pm
Post subject: Re: not printing pages [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
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.DeleteThis@discussions.microsoft.com>
wrote:
>I have a 15 page spread sheet that is linked to another sheet 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?
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum