Hätte eine blöde Frage:
Wie kann ich mit VBA erreichen, dass die Spalte C1:C60 nicht in der Seitenansicht und auch nicht gedruckt wird. Grund: Habe dort Listenvermerke drin.
Für Eure generöse Hilfe danke ich schon im Voraus
Salvus
Frederic
Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Columns("C:C").Font.ColorIndex = 2
End Sub
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Columns("C:C").Font.ColorIndex = 0
End Sub
wird bei der Seitenansicht und beim Drucken die Spalte C als weiß, also nicht sichtbar, dargestellt.
Das Problem ist, dass es so bleibt, bis das Blatt deaktiviert und wieder aktiviert wird. Es gibt leider kein After Print Ereignis (:-/
Die Alternative wäre den Ausdruck über eine Befehlsschaltfläche zu starten. Dann könnte man nach PrintOUt die FontFarbe wieder auf Automatic setzen.
Ich stell die Frage mal offen, vielleicht weiß jemand einen Trick für AfterPrint.
Gruß
Uwe
(:o)
Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Tabelle1.Columns("C:C").Font.ColorIndex = 2
Application.OnTime Now + TimeValue("00:00:01"), "Druck_Zurückstellen"
End Sub
Modul Modul1
Option Explicit
Sub Druck_Zurückstellen()
Tabelle1.Columns("C:C").Font.ColorIndex = 0
End Sub
Gruß Tino
Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim ZellFormat As String
ZellFormat = Range("C1").NumberFormat
Tabelle1.Range("C1:C60").NumberFormat = ";;;"
Application.OnTime Now + TimeValue("00:00:01"), "'Druck_Zurückstellen """ & ZellFormat & """'"
End Sub
Modul Modul1
Option Explicit
Sub Druck_Zurückstellen(ZellFormat As String)
Tabelle1.Range("C1:C60").NumberFormat = ZellFormat
End Sub
Gruß Tino