Ich habe eine Exceldatei die aus mehreren Sheets besteht.
Auf jedem dieser Sheets steht immer in der gleichen Zelle eine Info die nicht gedruckt werden soll. Ist das irgendwie möglich?
Vielen Dank!
lg Jean
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Range("A1").Font.ColorIndex = 2
End Sub
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Range("A1").Font.ColorIndex = 2
End Sub
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Range("A1").Font.ColorIndex = 3
End Sub
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Range("A1").NumberFormat = ";;;"
End Sub
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Range("A1").NumberFormat = "General"
End Sub
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim Farbe As Integer
Dim wks As Worksheet
Dim i As Byte
On Error GoTo Fehler
For Each wks In Me.Worksheets
If ActiveSheet.Name = wks.Name Then
i = 1
Exit For
End If
Next wks
If i = 1 Then
Cancel = True
Farbe = ActiveSheet.Range("A1").Font.ColorIndex
ActiveSheet.Range("A1").Font.ColorIndex = 2
Application.EnableEvents = False
ActiveSheet.PrintOut
Application.EnableEvents = True
ActiveSheet.Range("A1").Font.ColorIndex = Farbe
End If
Fehler:
Application.EnableEvents = True
End Sub