AW: sverweis in schleife unter Bedingung
17.06.2021 10:13:39
Fred
Hallo Excel Profis,
nun habe ich das gewünschte Ergebnis (addieren der gezählten Farben und in gewünschte Zeile zuordnen) mit vba selbst auf die Reihe bekommen.
Die Matrix "X2:AA7" scheint "überflüssig" zu sein,- aber ich habe diese dennoch genutzt.
Der vba-Zusatz :
If .Cells(3, 22) = "clean Sheet" Then .Cells(lngC, 19) = .Cells(3, 23)
If .Cells(3, 22) = "clean Sheet" Then .Cells(lngC, 20) = .Cells(2, 25)
If .Cells(3, 22) = "clean Sheet" Then .Cells(lngC, 21) = .Cells(2, 26)
If .Cells(3, 22) = "clean Sheet" Then .Cells(lngC, 22) = .Cells(2, 27)
If .Cells(3, 22) = "beide treffen nicht" Then .Cells(lngC, 19) = .Cells(3, 23)
If .Cells(3, 22) = "beide treffen nicht" Then .Cells(lngC, 20) = .Cells(3, 25)
If .Cells(3, 22) = "beide treffen nicht" Then .Cells(lngC, 21) = .Cells(3, 26)
If .Cells(3, 22) = "beide treffen nicht" Then .Cells(lngC, 22) = .Cells(3, 27)
If .Cells(3, 22) = "win to Nil" Then .Cells(lngC, 19) = .Cells(3, 23)
If .Cells(3, 22) = "win to Nil" Then .Cells(lngC, 20) = .Cells(4, 25)
If .Cells(3, 22) = "win to Nil" Then .Cells(lngC, 21) = .Cells(4, 26)
If .Cells(3, 22) = "win to Nil" Then .Cells(lngC, 22) = .Cells(4, 27)
If .Cells(3, 22) = "win 1 halftime" Then .Cells(lngC, 19) = .Cells(3, 23)
If .Cells(3, 22) = "win 1 halftime" Then .Cells(lngC, 20) = .Cells(5, 25)
If .Cells(3, 22) = "win 1 halftime" Then .Cells(lngC, 21) = .Cells(5, 26)
If .Cells(3, 22) = "win 1 halftime" Then .Cells(lngC, 22) = .Cells(5, 27)
If .Cells(3, 22) = "win 2 halftime" Then .Cells(lngC, 19) = .Cells(3, 23)
If .Cells(3, 22) = "win 2 halftime" Then .Cells(lngC, 20) = .Cells(6, 25)
If .Cells(3, 22) = "win 2 halftime" Then .Cells(lngC, 21) = .Cells(6, 26)
If .Cells(3, 22) = "win 2 halftime" Then .Cells(lngC, 22) = .Cells(6, 27)
If .Cells(3, 22) = "über 2,5" Then .Cells(lngC, 19) = .Cells(3, 23)
If .Cells(3, 22) = "über 2,5" Then .Cells(lngC, 20) = .Cells(7, 25)
If .Cells(3, 22) = "über 2,5" Then .Cells(lngC, 21) = .Cells(7, 26)
If .Cells(3, 22) = "über 2,5" Then .Cells(lngC, 22) = .Cells(7, 27)
If .Cells(3, 22) = "über 3,5" Then .Cells(lngC, 19) = .Cells(3, 23)
If .Cells(3, 22) = "über 3,5" Then .Cells(lngC, 20) = .Cells(8, 25)
If .Cells(3, 22) = "über 3,5" Then .Cells(lngC, 21) = .Cells(8, 26)
If .Cells(3, 22) = "über 3,5" Then .Cells(lngC, 22) = .Cells(8, 27)
https://www.herber.de/bbs/user/146654.xlsb
Meine Abschlussfrage wäre noch;
Ist der Code so wie ich diesen geschrieben habe OK und optimal,- oder kann man da etwas verbessern?
Gruss
Fred