es ist zwar eine spielerei, aber ich bekomme es trotzdem nicht hin
Zelle O50:P50 nicht zu drucken in eine PDF.
O50:P50 ist ein link zum anderen Arbeitsblatt "KuG" = Kurzarbeit
Hat jemand eine Lösung?
https://www.herber.de/bbs/user/155867.xls
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim Farbe1 As Integer, Farbe2 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
Farbe1 = ActiveSheet.Range("A1").Font.ColorIndex
ActiveSheet.Range("A1").Font.ColorIndex = 2
Farbe2 = ActiveSheet.Range("O50").Font.ColorIndex
ActiveSheet.Range("O50").Font.ColorIndex = 2
Application.EnableEvents = False
ActiveSheet.PrintOut
Application.EnableEvents = True
ActiveSheet.Range("A1").Font.ColorIndex = Farbe1
ActiveSheet.Range("O50").Font.ColorIndex = Farbe2
End If
Fehler:
Application.EnableEvents = True
End Sub
LG UweD