Before Print and After Print Event error is not working.
sheet2 has certain coloured cell. (before and after print)
but when print out, coloured cell should be blank.
MY Code
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Sheets(2).Range(“B4:H17”).Interior.Color = RGB(255, 255, 255)
Sheets(2).Range(“B23:H25”).Interior.Color = RGB(255, 255, 255)
‘free to add more ranges
Application.OnTime Now, “AfterPrint”
‘Return back to original color
End Sub
Sub AfterPrint()
Sheets(2).Range(“B4:H17”).Interior.Color = RGB(100, 100, 100) “No colour”
Sheets(2).Range(“B23:H25”).Interior.Color = RGB(100, 100, 100)
End Sub
Hyun Jeong Lee is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.