Hallo Albi,
Mach in der Userform astatt deinem code der Commandbutton denn hier:
Private Sub CommandButton1_Click()
Dim intErsteLeerZeile As Long
With ThisWorkbook.Worksheets("Tabelle1")
intErsteLeereZeile = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
.Cells(intErsteLeereZeile, 1).Value = (Application.WorksheetFunction.Max(.Range("A2:A" & intErsteLeereZeile & "")) + 1) * 1
.Cells(intErsteLeereZeile, 2).Value = Me.txtFirma.Value
.Cells(intErsteLeereZeile, 3).Value = Me.txtStraße.Value
.Cells(intErsteLeereZeile, 4).Value = Me.txtPLZ.Value
.Cells(intErsteLeereZeile, 5).Value = Me.txtOrt.Value
.Cells(intErsteLeereZeile, 6).Value = Me.txtLand.Value
.Cells(intErsteLeereZeile, 7).Value = Me.txtAnrede.Value
.Cells(intErsteLeereZeile, 8).Value = Me.txtEmail.Value
.Cells(intErsteLeereZeile, 9).Value = Me.txtTel.Value
.Cells(intErsteLeereZeile, 10).Value = Me.txtFax.Value
.Cells(intErsteLeereZeile, 11).Value = Me.txtHomepage.Value
.Cells(intErsteLeereZeile, 12).Value = Me.txtHinweise.Value
End With
Unload Formular
End Sub
und Formatiere die Spalte A als Zahl ohne komma nicht als Text.
Dann Formatiere Spalte A noch als Benutzerdefiniert mit vier Nuller also so 0000.
Dann müßte es funtzen.
Er nimmt immer dann das Maximalste von Spalte A + 1.
|