Hallo nochmal ich :)
Wie müsste ich denn folgenden code ändern, sodass nicht abgebrochen wird wenn ein Wert in Bereich 1 gefunden wird und der Bereich 2 trotzdem durchsucht werden soll?
zeile = Sheets("Neuwagen").Cells(Rows.Count, 1).End(xlUp).Row
Dim x As Long
x = 2
Do
With Sheets("Neuwagen")
datum1 = .Cells(x, 13).Value
zeit1 = .Cells(x, 14).Text
End With
If (datum = datum1 And zeit1 = "9:00") Then
Label120.Caption = Cells(x, 5).Value 'Name
Label121.Caption = Cells(x, 12).Value 'Kennzeichen
Label208.Caption = Cells(x, 1).Value 'FIN
Exit Do
End If
If x = zeile Then Exit Do
x = x + 1
Loop
If datum = datum1 Then
Else
x = 2
zeile = Sheets("Neuwagen").Cells(Rows.Count, 29).End(xlUp).Row
Do
With Sheets("Neuwagen")
datum2 = .Cells(x, 32).Value
zeit2 = .Cells(x, 33).Text
End With
If (datum = datum2 And zeit2 = "9:00") Then
Label300.Caption = Cells(x, 31).Value
Label313.Caption = Cells(x, 29).Value
Label326.Caption = Cells(x, 30).Value
Exit Do
End If
If x = zeile Then Exit Do
x = x + 1
Loop
End If
Grüße
Sino
|