Private
Sub
Button_erfassen_neu_Click()
Dim
last
As
Integer
last = ActiveSheet.Cells(Rows.Count, 2).
End
(xlUp).Row + 1
Dim
lngLast
As
Long
Dim
lngMax
As
Long
lngLast = Cells(Rows.Count, 2).
End
(xlUp).Row
lngMax = Application.WorksheetFunction.Max(Columns(
"A"
))
Cells(lngLast + 1, 1).Value = lngMax + 1
If
TextBox1_vorname =
""
Then
MsgBox
"Bitte geben Sie einen Vornamen ein:"
Cells(last, 2).Value = TextBox1_vorname
If
TextBox2_Nachname =
""
Then
MsgBox
"Bitte geben Sie einen Nachnamen ein:"
:
Exit
Sub
Cells(last, 3).Value = TextBox2_Nachname
If
TextBox3_strasse =
""
Then
MsgBox
"Bitte geben Sie die Straße ein:"
:
Exit
Sub
Cells(last, 4).Value = TextBox3_strasse
End
sub