Cell-setting not to print

  • Thread starter Thread starter Sherry
  • Start date Start date
S

Sherry

How do I set a cell to be able to see it, and change it,
but for it not to print when I print the work sheet?
 
You could hide the row/column.

Or format the cell with a custom format of ";;;" (don't use the quotes)

Or give it the same font color as the fill color.

Then change it back when you're done printing.

And as a macro:

How about giving your range a range name ("hideme"???)

then in the workbook_beforeprint event, you can format the range as ;;;. This
hides the contents. Then print, then change it back to whatever it was. I
chose "general" for my example.

Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)

Range("hideme").NumberFormat = ";;;"

Application.EnableEvents = False
PrintOut
Application.EnableEvents = True

Range("hideme").NumberFormat = "General"

Cancel = True

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Back
Top