suppress printing on certain rows

G

Guest

How do I suppress the printing of certain rows in a spreadsheet? If there is
not a value in a particular cell in the row I do not want the row to print.
 
P

papou

Hello Valerie
Why not hide the relevant rows?
You could also envisage a programming solution.

HTH
Cordially
Pascal
 
G

Guest

Someone other than myself will be working in the spreadsheet. They have
limited ability and will basically be performing data entry and printing
only. There are about 500 rows in the spreadsheet. At any point in time
there may only be 25 rows with values scattered throughout the spreadsheet
that she would want to print.

I want her to be able to see all of the rows, yet only print those with
values. I don't want her to have to hunt & peck for the rows with values.
What would the easiest solution be?
 
G

Guest

Wouldn't each row have to be selected to hide? I need something that would
be automatic.
 
G

Gord Dibben

Autofilter for non-blanks then print.

Record a macro while doing this.


Gord Dibben MS Excel MVP
 
I

igbert

Hi Ron De Bruin,

I have used your Macros in Excel 2007 to supress printing of certain Rows

Private Sub Workbook_BeforePrint(Cancel As Boolean)

' Hide Row 1 to Row 5 when printing

If ActiveSheet.Name = "Adjustment" Then
Cancel = True
Application.EnableEvents = False
Application.ScreenUpdating = False
With ActiveSheet
.Rows("1:5").EntireRow.Hidden = True
.PrintOut
.Rows("1:5").EntireRow.Hidden = False
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub

However, after I clicked "Print Preview", all toolbar icons are disable for
selection.

When I take out the above Macro, selection becomes available.

Could you show me how to fix it.

Thanks.

Igbert Au-Yeung
 

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