Ja sorry, das ist der richtige ohne springe zum ersten :=)
Dim stelle As Long
Sub filter_zurück()
stelle = stelle - 1
If ActiveSheet.AutoFilterMode = True Then Range("A2:P2").AutoFilter
Set liste = CreateObject("System.collections.arraylist")
'Zeile 1 ist Übeschrift
For i = 2 To ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
'MsgBox liste.contains(Cells(i, 1))
If liste.contains(CStr(Cells(i, 1))) = "Falsch" Then
liste.Add CStr(Cells(i, 1))
End If
Next
If stelle = -1 Then
Set liste = Nothing
Exit Sub
End If
If stelle = -2 Then stelle = liste.Count - 1
Range("A2:P2").AutoFilter
Range("A2:P2").AutoFilter Field:=1, Criteria1:=Replace(liste.Item(stelle), ",", ".")
Set liste = Nothing
End Sub
Sub filter_vor()
stelle = stelle + 1
If ActiveSheet.AutoFilterMode = True Then Range("A2:P2").AutoFilter
Set liste = CreateObject("System.collections.arraylist")
'Zeile 1 ist Übeschrift
For i = 2 To ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
'MsgBox liste.contains(Cells(i, 1))
If liste.contains(CStr(Cells(i, 1))) = "Falsch" Then
liste.Add CStr(Cells(i, 1))
End If
Next
If stelle = liste.Count Then
Set liste = Nothing
Exit Sub
End If
If stelle > liste.Count Then stelle = 0
Range("A2:P2").AutoFilter
Range("A2:P2").AutoFilter Field:=1, Criteria1:=Replace(liste.Item(stelle), ",", ".")
Set liste = Nothing
End Sub
|