Ein Teil Teil meines Makros sieht so aus:
xyx = 0
ersatz1:
For ersatz = 1 To 42
On Error GoTo ERSATZENDE
xyx = xyx + 1
If xyx = 43 Then GoTo ERSATZENDE
Sheets("Besetzung").Select
Cells(xyx, 2).Select
wert6 = ActiveCell.Value
If wert6 <> "" Then GoTo ERSATZENDE
If wert6 = "" Then Cells(xyx, 1).Select
wert2 = ActiveCell.Value
Sheets("Drucken").Select
Range("a1").Select
Set R1 = Application.InputBox(prompt:="Möglichen Ersatzmitarbeiter auswählen...", Title:=wert2, Type:=8)
x1 = R1
xyy = 0
test2:
xyy = xyy + 1
If xyy = 60 Then xyy = 1
Sheets("Besetzung").Select
Cells(xyy, 2).Select
wert3 = ActiveCell.Value
If R1 <> wert3 Then GoTo test2
If R1 = wert3 Then ActiveCell.FormulaR1C1 = ""
Sheets("Besetzung").Select
Cells(xyx, 2).Select
ActiveCell.FormulaR1C1 = x1
ERSATZENDE:
Next ersatz
Wenn ich jetzt auf abbrechen gehen kommt teilweise ein Fehler und ich verstehe nicht warum?
Seht ihr einen Fehler?
MfG
Karsten