Option
Explicit
Private
Sub
UserForm_Activate()
Me
.TextBox1.Value =
""
Me
.TextBox2.Value =
""
Me
.TextBox3.Value =
""
End
Sub
Private
Sub
CommandButton1_Click()
On
Error
GoTo
Fehler
Const
APPNAME =
"CommandButton1_Click"
With
ActiveSheet
Application.EnableEvents =
False
.Cells(Zeile, 3) =
Me
.TextBox1.Value
.Cells(Zeile, 4) =
Me
.TextBox2.Value
.Cells(Zeile, 5) =
Me
.TextBox3.Value
Application.EnableEvents =
True
End
With
UserForm1.Hide
Err.Clear
Fehler:
Application.EnableEvents =
True
If
Err.Number <> 0
Then
MsgBox
"Fehler in Sub "
""
& APPNAME &
""
""
& vbCrLf _
&
"Fehlernummer: "
& Err.Number & vbLf & Err.Description: Err.Clear
End
Sub