Private
Sub
CommandButton1_Click()
If
Application.Caller =
"Minus"
Then
Range(
"A2"
) = Range(
"A2"
) -
CLng
(
Me
.TextBox1)
Unload
Me
ElseIf
Application.Caller =
"Plus"
Then
Range(
"A2"
) = Range(
"A2"
) +
CLng
(
Me
.TextBox1)
Unload
Me
End
If
End
Sub
Private
Sub
CommandButton2_Click()
Unload
Me
End
Sub
Private
Sub
Textbox1_KeyPress(
ByVal
KeyAscii
As
MSForms.ReturnInteger)
Select
Case
KeyAscii
Case
48
To
57
Case
Else
KeyAscii = 0
MsgBox
"Fehler: Es sind nur ganze Zahlen erlaubt."
End
Select
End
Sub
Private
Sub
UserForm_Initialize()
If
Application.Caller =
"Minus"
Then
Me
.Caption =
"Minus"
ElseIf
Application.Caller =
"Plus"
Then
Me
.Caption =
"Plus"
End
If
End
Sub