Option
Explicit
Private
Sub
CommandButton1_Click()
DokuNr.Hide
End
Sub
Sub
Hinzufuegen_Click()
Dim
last
As
Integer
Worksheets(
"Tabelle2"
).Activate
last = ActiveSheet.Cells(Rows.Count, 1).
End
(xlUp).Row + 1
Dim
Doku
As
Integer
Cells(last, 1).Value = Nr
Cells(last, 3).Value = Text1
Cells(last, 2).Value = Text2
Cells(last, 4).Value = Text3
Text1=
""
Text2=
""
Text3=
""
ActiveWorkbook.Worksheets(
"Tabelle2"
).ListObjects(
"TAB1"
).Sort.SortFields. _
Clear
ActiveWorkbook.Worksheets(
"Tabelle2"
).ListObjects(
"TAB1"
).Sort.SortFields. _
Add2 Key:=Range(
"TAB1[[#All],[Nummer]]"
), SortOn:=xlSortOnValues, _
Order:=xlAscending, DataOption:=xlSortNormal
With
ActiveWorkbook.Worksheets(
"Tabelle2"
).ListObjects(
"TAB1"
).Sort
.Header = xlYes
.MatchCase =
False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End
With
End
Sub