Option
Explicit
Private
Sub
bei_start_inputbox()
Dim
vntInput
As
Variant
With
ThisWorkbook.Worksheets(
"Tabelle1"
).Cells(1, 1)
Do
vntInput = InputBox(Prompt:=
"Eingabe-Pers. NR"
, Title:=
"Abfrage Pers.-Nr."
,
Default
:=.Value)
If
StrPtr(vntInput) = 0
Then
Call
MsgBox(
"Bitte bestätigen Sie Ihre Eingabe mit 'Ok'"
)
ElseIf
Trim$(vntInput) =
""
Then
Call
MsgBox(
"Nix eingegeben"
)
ElseIf
Not
IsNumeric(vntInput)
Then
Call
MsgBox(
"Bitte geben Sie eine Zahl ein.."
)
ElseIf
IsNumeric(vntInput)
And
(
CLng
(vntInput) \ 10000 < 1
Or
CLng
(vntInput) \ 10000 > 9)
Then
Call
MsgBox(
"Die eingebene Zahl muß exakt fünf Ziffern enthalten..."
)
Else
Exit
Do
End
If
Loop
.Value = vntInput
End
With
End
Sub
Private
Sub
Workbook_Open()
Call
bei_start_inputbox
End
Sub