Hallo Experten,
ich habe eine Tabelle (siehe Anhang) aus der ich aus den Spalten M und N alle Fehler kleiner 2 streichen möchte und anstelle dieser eine Null reinschreiben möchte.
Danach soll der Vergleichsalgorithmus gestartet werden, um die Bewertung zu erhalten:
Um die Fehler zu filtern, habe ich vor dem Abschnitt Auswerten Anzahl richtig folgendes eingefügt
Leider funktioniert das aber nicht!
Kann mir einer bitte sagen, was ich falsch mache?
Danke!
Gruß fari
ich habe eine Tabelle (siehe Anhang) aus der ich aus den Spalten M und N alle Fehler kleiner 2 streichen möchte und anstelle dieser eine Null reinschreiben möchte.
Danach soll der Vergleichsalgorithmus gestartet werden, um die Bewertung zu erhalten:
Visual Basic-Quellcode
- Public Sub BewertungInlineCT()
- Dim arrY As Variant, arrG As Variant, arrP As Variant
- Dim r As Long, y As Integer, g As Integer, reslt As Integer
- '***Geschwindigkeitsoptimierung Anfang
- Application.ScreenUpdating = False
- Application.Calculation = xlCalculationManual
- '***Auswertung durchführen
- With Worksheets("BewertungInlineCT")
- For r = 3 To 12
- '***Einlesen Zeile Y=Yellow, G=Green, P=Purple
- arrY = .Cells(r, "H").Resize(1, 4)
- arrG = .Cells(r, "M").Resize(1, 2)
- arrP = .Cells(r, "Q").Resize(1, 2)
- '***Auswerten "Anzahl Fehler" Yellow
- reslt = 0
- For y = 1 To UBound(arrY, 2) Step 2
- If arrY(1, y) > 0 Or arrY(1, y + 1) > 0 Then reslt = reslt + 1
- Next y
- .Cells(r, "G") = reslt
- '***Auswerten "Anzahl Fehler" Green
- reslt = 0
- For g = 1 To UBound(arrG, 2)
- If arrG(1, g) > 0 Then reslt = reslt + 1
- Next g
- .Cells(r, "L") = reslt
- '***Auswerten "Anzahl richtig"
- reslt = 0
- For g = 1 To UBound(arrG, 2)
- If arrG(1, g) <> 0 And Not IsEmpty(arrG(1, g)) Then
- For y = 1 To UBound(arrY, 2) Step 2
- If arrG(1, g) >= (arrY(1, y) - 2) And arrG(1, g) <= (arrY(1, y + 1) + 2) Then
- reslt = reslt + 1
- arrY(1, y) = Empty: arrY(1, y + 1) = Empty
- arrG(1, g) = Empty
- Exit For
- End If
- Next y
- End If
- Next g
- .Cells(r, "D") = IIf(reslt > 0, reslt, "")
- '***Auswerten "Anzahl Schlupf"
- reslt = 0
- For g = 1 To UBound(arrG, 2)
- If arrG(1, g) <> 0 And Not IsEmpty(arrG(1, g)) Then
- reslt = reslt + 1
- arrG(1, g) = Empty
- End If
- Next g
- .Cells(r, "E") = IIf(reslt > 0, reslt, "")
- '***Auswerten "Anzahl Pseudo"
- reslt = 0
- For y = 1 To UBound(arrY, 2) Step 2
- If arrY(1, y) <> 0 And Not IsEmpty(arrY(1, y)) And _
- arrY(1, y + 1) <> 0 And Not IsEmpty(arrY(1, y + 1)) Then
- reslt = reslt + 1
- arrY(1, y) = Empty: arrY(1, y + 1) = Empty
- End If
- Next y
- .Cells(r, "F") = IIf(reslt > 0, reslt, "")
- '***Auswerten "Gesamtentscheid"
- .Cells(r, "B") = IIf(.Cells(r, "E") + .Cells(r, "F") > 0, 0, 1)
- Next r
- End With
- '***Geschwindigkeitsoptimierung Ende
- Application.ScreenUpdating = True
- Application.Calculation = xlCalculationAutomatic
- End Sub
Um die Fehler zu filtern, habe ich vor dem Abschnitt Auswerten Anzahl richtig folgendes eingefügt
Leider funktioniert das aber nicht!
Kann mir einer bitte sagen, was ich falsch mache?
Danke!
Gruß fari