Set certain cells to print and others not to print

X

xp

I am working on a form in XL2007.

The form consumes one 8.5 by 11 page.

I would like to set certain cells to be visible on screen, but not print
their contents. This would need to be done almost on a cell by cell basis. Is
something like this possible?

Thanks!
 
D

Dennis Tucker

There is a special cell format for this.

Search excel's help for "Hide or display cell values"
 
P

Project Mangler

What about setting the ink colour the same as the background before
printing, then restore after printing?
This assumes a white background and uniform cell formatting:

Sub SelectivePrint()
Dim R As Range

'select the target sheet
Sheets("Sheet1").Select
'Create a range object containing the cells which are not to print
Set R = Application.Union(Range("a4:a5"), _
Range("b8:b8"), Range("c9:c10"), _
Range("D8"))
'set the ink colour to match the background (white in this case)
R.Font.ColorIndex = 19
'print one copy of the sheet
ActiveWindow.SelectedSheets.PrintOut , , 1
'restore the automatic colour
R.Font.ColorIndex = 0
End Sub
 
Top