Private
Sub
ComboBox1_Exit(
ByVal
Cancel
As
MSForms.ReturnBoolean)
Dim
TB1, TB2, Zeile
As
Long
, Z
As
Long
, TMP
As
Variant
Set
TB1 = Sheets(
"Tabelle1"
)
Set
TB2 = Sheets(
"Tabelle2"
)
Zeile = 3
With
ComboBox1
If
.Text <>
""
Then
TB1.Cells(Zeile, 1) = .Text
Z = WorksheetFunction.CountIf(TB2.Columns(1), .Text)
If
Z > 0
Then
Z = WorksheetFunction.Match(.Text, TB2.Columns(1), 0)
TMP = TB2.Cells(Z, 2)
Else
TMP =
"Not found"
End
If
TB1.Cells(Zeile, 2) = TMP
End
If
End
With
End
Sub