Dim dumparrl As New ArrayList
Dim dumparrly As Integer = 0
Dim dumparrly2 As Integer
Dim dumparrEntCnt As Integer
Dim dumparrlstrg As String
Dim dumparrlCnt As Integer
Dim itmval As String
Dim FailStr As Boolean
While objExcelsht.Cells(rw, 10).value <> ""
dumparrl.Add(objExcelsht.Cells(rw, 10).value)
rw = rw + 1
End While
dumparrly = 0
dumparrlCnt = dumparrl.Count
For x As Integer = 1 To dumparrlCnt
dumparrlstrg = dumparrl.Item(dumparrly2)
For Each Array In dumparrl
itmval = dumparrl.Item(dumparrly).ToString
If String.Compare(dumparrlstrg, itmval, True) = 0 Then
dumparrEntCnt = dumparrEntCnt + 1
End If
dumparrly = dumparrly + 1
Next
dumparrly = 0
Select Case dumparrlstrg
Case "Leitapparat ZUS FSP"
FailStr = True
Case "Francis Laufrad ZUS"
FailStr = True
Case Else
FailStr = False
End Select
If dumparrEntCnt > 2 And FailStr = True Then
MsgBox("AUSNAHMEZUSTAND: Zuviel: " & dumparrlstrg)
Exit Sub
Else
dumparrly2 = dumparrly2 + 1
dumparrEntCnt = 1
End If
Next