print hidden values

J

Jeannine

I have a spreadsheet that has two cells that I have hidden by going into
format cells to number and typed ;;; (3 semicolons) in the type box.

I would like to be able to have the sheet print without the value showing on
the screen. Does anyone know how to set a macro to allow hidden cells to
print?
 
E

Earl Kiosterud

Jeannine,

This might do it:

Sub PrintWithHidden()
Application.ScreenUpdating = False ' Prevent screen from showing hidden
stuff while printing
Range("A2").NumberFormat = "General" ' or whatever is appropriate for
printing the hidden cell
ActiveSheet.PrintOut
Range("A2").NumberFormat = ";;;" ' set it back
Application.ScreenUpdating = True
End Sub
 
Top