Retroshift
09-25-2016, 11:52 AM
Hi VBA-experts,
I'm looking for a working code to clear conditional formatting of different cells before printing and restore them after printing. The macro should run automatically when I want to print the specific worksheet and also restore the conditional formatting after printing. The removal of the conditional formatting cells should be visible on the print preview of the Excel document.
I had an idea for some basic code but it is far from complete. (no use of buttons or datavalidation please and the final document is printed in color (but not the cleared conditional formatting cells))
Thanks
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Sheets("Sheet1").Range("B6,B10").FormatConditions.Delete
End Sub
I'm looking for a working code to clear conditional formatting of different cells before printing and restore them after printing. The macro should run automatically when I want to print the specific worksheet and also restore the conditional formatting after printing. The removal of the conditional formatting cells should be visible on the print preview of the Excel document.
I had an idea for some basic code but it is far from complete. (no use of buttons or datavalidation please and the final document is printed in color (but not the cleared conditional formatting cells))
Thanks
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Sheets("Sheet1").Range("B6,B10").FormatConditions.Delete
End Sub