Private
Sub
CommandButton6_Click()
Dim
lZeile
As
Long
If
ListBox1.ListIndex = -1
Then
Exit
Sub
lZeile = 2
Do
While
Trim(
CStr
(Tabelle1.Cells(lZeile, 1).Value)) <>
""
If
ListBox1.Text = Trim(
CStr
(Tabelle1.Cells(lZeile, 1).Value))
Then
Tabelle1.Rows(
CStr
(lZeile &
":"
& lZeile)).Copy Destination:=Worksheets(
"Datenbank"
).Range(
"B:TH"
)
Call
UserForm_Initialize
If
ListBox1.ListCount > 0
Then
ListBox1.ListIndex = 0
Exit
Do
End
If
lZeile = lZeile + 1
Loop
Dim
lZeile
As
Long
lZeile = 2
Do
While
Trim(
CStr
(Tabelle1.Cells(lZeile, 1).Value)) <>
""
lZeile = lZeile + 1
Loop
Tabelle1.Cells(lZeile, 1) =
CStr
(
"ID-Vorschlag: "
& lZeile)
ListBox1.AddItem
CStr
(
"ID-Vorschlag: "
& lZeile)
ListBox1.ListIndex = ListBox1.ListCount - 1
End
Sub