Sub Test()
Dim x, b As Boolean
Do Until b
x = Application.InputBox("Letzte 7 Stellen:", "Eingabe", , , , , , 1)
b = CBool(x)
If b Then
If Len(x) <> 7 Then
MsgBox "Bitte 7 Ziffern eingeben"
b = False
End If
Else
MsgBox "Abbruch"
Exit Sub
End If
Loop
MsgBox "Test"
End Sub