AW: Der Weisheit letzter Schluß?
30.01.2020 08:28:32
Josi
Ok .
Vielen Dank für den Tip.
Nun hab ich das Makro aufgeteilt und rufe den 2ten Teil mit CALL auf.
Damit geht es. Aber ist das der Weisheit letzter Schluß?
Sub Spieltag_1()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
Select Case ws.Name
Case "A", "Tabelle2"
Sheets(ws.Name).Select
Range("f4:f36").Font.ColorIndex = 0
If Range("e9") = "" Then
Range("a4:m36").Sort key1:=Range("e4"), order1:=xlAscending, _
key2:=Range("f4"), Order2:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal
Range("f4:f7").Font.ColorIndex = 10
Range("f8:f10").Font.ColorIndex = 3
Else
Range("a4:m36").Sort key1:=Range("e4"), order1:=xlAscending, _
key2:=Range("f4"), Order2:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal
Range("f4:f6").Font.ColorIndex = 32
Range("f7:f9").Font.ColorIndex = 10
Range("f10").Font.ColorIndex = 32
Range("f11").Font.ColorIndex = 10
Range("f12:f14").Font.ColorIndex = 3
Range("C4").Select
Range("a4:af36").Sort key1:=Range("p4"), order1:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal
Call a
End If
End Select
Next ws
Calculate
End Sub
Sub a()
Range("a4:af36").Sort key1:=Range("p4"), order1:=xlDescending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal
End Sub