Einen VBA Code habe ich mir ja erstellt aber dieser Hilft mir nur wenn die Mindestens 9 eingaben
gemacht sind also ab der 10. Eingabe
Code:
Sub Doppelte_Markieren()
Cells(25, 2) = ""
Cells(25, 2).Interior.ColorIndex = 55
Cells(24, 22) = ""
For Zeile = 3 To 20 Step 2
For Spalte = 2 To 21
Cells(Zeile, Spalte).Interior.ColorIndex = 42
Cells(Zeile, Spalte).Font.ColorIndex = 1
Cells(Zeile + 1, Spalte).Interior.ColorIndex = 19
Cells(Zeile + 1, Spalte).Font.ColorIndex = 1
Cells(21, Zeile + 1).Interior.ColorIndex = 19
Cells(21, Zeile).Interior.ColorIndex = 42
Cells(23, Zeile + 1).Interior.ColorIndex = 42
Cells(23, Zeile).Interior.ColorIndex = 19
Cells(46, 22).Interior.ColorIndex = 42
Next Spalte
Next Zeile
ErsteZeile = 28
LetzteZeile = Cells(Rows.Count, 2).End(xlUp).Row
ErsteSpalte = 4
LetzteSpalte = 21 'Cells(28, Columns.Count).End(xlToLeft).Column
Range(Cells(27, ErsteSpalte), Cells(27, LetzteSpalte)).Interior.ColorIndex = 2
For Zeile = ErsteZeile To LetzteZeile
For Spalte = ErsteSpalte To LetzteSpalte
Cells(Zeile, Spalte).Interior.ColorIndex = 2
Cells(Zeile, 2).Interior.ColorIndex = 2
Cells(Zeile, 3).Interior.ColorIndex = 2
If Cells(21, Spalte) > 9 Then
Cells(21, Spalte).Interior.ColorIndex = 6
Spalte2 = Cells(21, Spalte).Value
End If
If Cells(27, Spalte).Interior.ColorIndex = 6 Then
Cells(1, 1) = Cells(27, Spalte).Value
End If
If Cells(Zeile, Spalte) = 2 Then
Cells(Zeile, Spalte).Interior.ColorIndex = 6
Cells(27, Spalte).Interior.ColorIndex = 6
Cells(1, 1) = Cells(27, Spalte).Value
Cells(Zeile - 25, 3).Interior.ColorIndex = 6
Cells(25, 2).Interior.ColorIndex = 3
Cells(25, 2).Font.ColorIndex = 6
Cells(24, 22) = Cells(Zeile - 25, 3).Value
VereinsName = Cells(24, 22).Value
sSuchbegriff = VereinsName
Doppelt = Spalte2
sSuchbegriff2 = Doppelt
GegnerNummer = Cells(1, 1).Value
sSuchbegriff3 = GegnerNummer
Set Doppelte = Worksheets("Spielplan").Range("Teams").Find(what:=sSuchbegriff, lookat:=xlWhole, LookIn:=xlValues)
Set DoppelSpalte = Worksheets("Spielplan").Range("GesSpiele").Find(what:=sSuchbegriff2, lookat:=xlWhole, LookIn:=xlValues)
Cells(Doppelte.Row, DoppelSpalte.Column).Interior.ColorIndex = 3
Cells(Doppelte.Row, DoppelSpalte.Column).Font.ColorIndex = 6
Set VereinsNamenSpalte = Worksheets("Spielplan").Range("GegnerNummern").Find(what:=sSuchbegriff3, lookat:=xlWhole, LookIn:=xlValues)
Cells(25, 2) = "Die Mannschaft " & _
Space(1) & Cells(VereinsNamenSpalte.Row, 3).Value & _
Space(1) & "mit der Nummer" & Space(3) & GegnerNummer & _
Space(1) & "ist doppelt vorhanden in der Zeile von" & _
Space(1) & Cells(Zeile - 25, 3).Value
End If
Cells(46, Spalte).Interior.ColorIndex = 40
If Cells(46, Spalte) > 0 Then
AlleSpiele = AlleSpiele + Cells(46, Spalte).Value
Cells(46, 22) = AlleSpiele / 9
End If
Next Spalte
AlleSpiele = 0
Next Zeile
End Sub