If ... And .......Then
04.11.2006 07:39:47
Mister
Kann mir jemand sagen wo der Fehler hier liegt:
Sub VerlegungZZ()
Dim i As Long
Application.ScreenUpdating = False
If UserForm1.CheckBox6.Value = True Then GoTo Ende:
If UserForm1.TextBox1.Value = "" Then GoTo Ende:
For i = 6 To 117
If UserForm1.TextBox1.Value = Sheets("ZZ").Cells(i, 3) _
And UserForm1.TextBox2.Value = Sheets("ZZ").Cells(i, 4) _
And UserForm1.TextBox4.Value = Sheets("ZZ").Cells(i, 5) _
And UserForm1.TextBox17.Value = Sheets("ZZ").Cells(i, 6) _
And UserForm1.TextBox18.Value = Sheets("ZZ").Cells(i, 7) Then
Sheets("ZZ").Cells(i, 9) = UserForm1.TextBox41.Value
Sheets("ZZ").Cells(i, 10) = UserForm1.TextBox42.Value
End If
Next
UserForm1.CheckBox6.Value = True
Ende:
Application.ScreenUpdating = True
End Sub
Obwohl die Bedingungen in diesem Falle WAHR sind, überspringt Excel die If - And - Then Prüfung. Wenn ich nur eine Bedingung einsetzte läuft alles richtig ab. Was mache ich falsch?
Gruß
Mister B