Cell invisible when printed.

  • Thread starter Thread starter Jim
  • Start date Start date
Here's one approach -

Format the font colour in cells you want to print non-visible with say
color-index 56. That's the almost black colour on the top right of the 40/56
colour palette.

' In the Thisworkbook module

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim origClr As Long

origClr = ThisWorkbook.Colors(56)
ThisWorkbook.Colors(56) = RGB(255, 255, 255) ' white

Application.OnTime Now, "'reSetPrintClr " & origClr & "' "
End Sub

' In a normal module

Sub reSetPrintClr(nClr As Long)
ThisWorkbook.Colors(56) = nClr
End Sub


If you want some other palette colour, record a macro while applying some
format with your colour, the colorindex will be recorded. As written, cells
on white backgrounds will be hidden whilst printed. For testing without
printing, activate the print dialog (File, print), have a look, then abort
the print

Come back if your not sure of the difference between "Thisworkbook" and
"normal" modules.

Regards,
Peter T
 

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

Back
Top