D
dgold82
I have 2 macros one for showing the print dialog (connected to a clipart
image of a printer) and the other to white out certain cells before print so
that they don't show. For some reason the print macro no longer works now
that I put in the before print macro. Any ideas? Fix? Here is my code below:
(I am running excel 2003, code below is in "thisworkbook")
Sub PrintSheet()
Application.Dialogs(xlDialogPrint).Show
End Sub
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "sheet1" Then
Cancel = True
Application.EnableEvents = False
Application.ScreenUpdating = False
With ActiveSheet
.Range("C4").Font.ColorIndex = 2
.PrintOut
.Range("C4").Font.ColorIndex = 1
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub
image of a printer) and the other to white out certain cells before print so
that they don't show. For some reason the print macro no longer works now
that I put in the before print macro. Any ideas? Fix? Here is my code below:
(I am running excel 2003, code below is in "thisworkbook")
Sub PrintSheet()
Application.Dialogs(xlDialogPrint).Show
End Sub
Private Sub Workbook_BeforePrint(Cancel As Boolean)
If ActiveSheet.Name = "sheet1" Then
Cancel = True
Application.EnableEvents = False
Application.ScreenUpdating = False
With ActiveSheet
.Range("C4").Font.ColorIndex = 2
.PrintOut
.Range("C4").Font.ColorIndex = 1
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub