VBA einkürzen
Tina
kann man folgendes noch besser einkürzen:
If Weekday(TB1.Cells(2, 1), 2) < 6 Then
TB2.Cells(3, 1) = Format(TB1.Cells(2, 1), "ddd dd.mm.yyyy")
End If
If Weekday(TB1.Cells(2, 1), 2) = 6 Then
TB2.Cells(3, 1) = Format(TB1.Cells(2, 1) + 2, "ddd dd.mm.yyyy")
End If
If Weekday(TB1.Cells(2, 1), 2) = 7 Then
TB2.Cells(3, 1) = Format(TB1.Cells(2, 1) + 1, "ddd dd.mm.yyyy")
End If
Grundsätzlich wird damit veranlasst:
wenn der Tag Mo bis Fr ist, dann trag ihn ein.
wenn der Tag Sa ist, dann zähl 2 Tage dazu
wenn der Tag So ist, dann zähl 1 Tag dazu
dadurch liste ich Tage auf, ohne das Wochenende.
Ich fürchte nur, dass es viel zu kompliziert ist.
Gruß
Tina