Prevent Printing of Specific Cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, folks. I'm looking for a way to format a cell so that the cell(s) will
_display_ on the worksheet, but not _print_ when the worksheet is printed.

I'm working on a sales worksheet. Some data on the worksheet, such as the
"dealer cost", need to be visible to the salesman and used in some
calculations, but if the salesman prints the worksheet, I don't want those
items to print.

Any thoughts?

Thanks.
 
Hmmm, I must not be doing it quite right.

I copied the appropriate sections of the code and ended up with

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.Rows("31:31").EntireRow.Hidden = True
.PrintOut
.Rows("31:31").EntireRow.Hidden = False
End With
End Sub

because I wanted to suppress printing for the cells in Row 31. Now it
prints the page twice; once with row 31 suppressed, and once with row 31
visible.

Any idea what I did wrong? Thanks.
 
The Stupid Way:

Link conditional formatting to a cell value to change the font and
background color to what ever color you decide. Change the value of
the cell in code or manually before printing. After printing, change
the value back.
 
Back
Top