FindNext
29.08.2016 15:32:18
Eisert
weiß jemand wie ich bei dem unten stehenden Code "FindNext" richtig einsetzten muss?
Ich will das nach "If Tabelle2.Cells(6, 1) = c Then" falls es zu keiner Übereinstimmung gekommen ist, weiter gesucht wird, bis alle Werte in der Spalte durchsucht sind. Irgendwie bekomme ich das nicht hin. Danke euch schon mal...
MfG Eisert
Private Sub CommandButton1_Click()
For i = 5 To 34
a = Tabelle2.Cells(5, i)
If Tabelle2.Cells(8, 1) = "Start" Then
Set b = Tabelle3.Range("D:D").Find(a, LookIn:=xlValues)
If b Is Nothing Then GoTo n1
c = b.Offset(0, -3)
If Tabelle2.Cells(6, 1) = c Then
Tabelle2.Cells(6, i) = b.Offset(0, 2)
End If
Else
Set b = Tabelle3.Range("E:E").Find(a, LookIn:=xlValues)
If b Is Nothing Then GoTo n1
c = b.Offset(0, -4)
If Tabelle2.Cells(6, 1) = c Then
Tabelle2.Cells(6, i) = b.Offset(0, 1)
End If
n1:
End If
Next i
End Sub