komme nicht aus Schleife raus!!!
11.09.2003 19:07:02
hendrik
ich habe diese echt simple For...Next Schleife in einer meiner Tabellen.
Problem:
warum wird sie nie verlassen??? Excel hängt sich bei mir jedesmal auf...
Ich habe sogar schon die (doch eigentlich überflüssige) GoTo-Funktion nutzen wollen, aber selbst da fängt die Schleife wieder von vorne an.
Steh ich hier irgendwie auf dem Schlauch??
For u = 20 To i + anzahl - 1
If .Cells(u, 19) = " - " Or IsEmpty(.Cells(u, 19)) Then
.Cells(u, 63) = 0
Else
.Cells(u, 63) = .Cells(u, 19) - .Cells(u, 20)
End If
If .Cells(u, 41) = " - " Or IsEmpty(.Cells(u, 41)) Then
.Cells(u, 64) = 0
Else
.Cells(u, 64) = .Cells(u, 41) - .Cells(u, 42)
End If
If .Cells(u, 48) = " - " Or IsEmpty(.Cells(u, 48)) Then
.Cells(u, 65) = 0
Else
.Cells(u, 65) = .Cells(u, 48) - .Cells(u, 49)
End If
If .Cells(u, 55) = " - " Or IsEmpty(.Cells(u, 55)) Then
.Cells(u, 66) = 0
Else
.Cells(u, 66) = .Cells(u, 55) - .Cells(u, 56)
End If
If u = i + anzahl - 1 Then
GoTo raushier
End If
Next
raushier: