How to prevent selected cells from printing, but have them visible?
I have created an extensive costing sheet for a sales rep that gets filled in and presented to a customer.
Part of one column contains dollar figures that need to be blank when printed, but must remain visible when entering data on the screen.
I have been searching, reading everything I can to figure out how to achieve this, but come up empty.
Is there any way to format a cell to be visible in the sheet, but not show up when printed?
It is not a whole column, so hiding it doesn't work.
I have tried setting the print area, selecting everything but the certain cells. That doesn't work either. It breaks my sheet into multiple pages to print in little sections.
Conditional formatting has no option for this.
Changing the cells to white font hides them from the user.
I tried setting cells only to hidden, but there is no option to not print hidden cells. I have looked everywhere for that.
I don't want to create macros, as this sheet gets emailed to people to fill in, and the antivirus software disables them. And besides, it just gets too complicated.
Something I thought so simple has become a headache.
Anyone know how to achieve this? - In a nutshell, certain cells visible but don't print.
BobsYourUncle54 Add a new cell style (see https://jkp-ads.com/articles/styles02.asp). Name the style HideWhenPrinting. Uncheck all boxes in the new style dialog, then click the Format button. On the Font tab, change the font to white and immediately change it back to Automatic. Click OK twice.
Highlight all cells which need to be absent from the print and set their style to the new HideWhenPrinting style.
Now hit alt+F11 to go to the VBA Editor. Double-click on the ThisWorkbook module in the project explorer, past this code:
Option Explicit Private Sub Workbook_BeforePrint(Cancel As Boolean) HideCells Application.OnTime Now, "'" & ThisWorkbook.FullName & "'!ShowAgain" End Sub
Insert a new module (Insert, Module form the menu) and paste this code:
Option Explicit Sub HideCells() With ActiveWorkbook.Styles("HideWhenPrinting").Font .ThemeColor = 1 End With End Sub Public Sub ShowAgain() With ActiveWorkbook.Styles("HideWhenPrinting").Font .ColorIndex = xlAutomatic End With End Sub
That should do it. I've attached a sample workbook with everything in place.