Code: Alles auswählen
Sub Main
With ThisComponent.Sheets
quelle = .getByName("Meine").getCellRangeByName("A1:A9000").getDataArray()
vergleich = .getByName("Fremde").getCellRangeByName("A1:B9000").getDataArray()
End With
k = 0
With ThisComponent.Sheets.getByName("Result")
For i = 0 To UBOUND(quelle())
For j = 0 To UBOUND(vergleich())
IF quelle(i)(0) = vergleich(j)(1) Then
.getCellByPosition(0, k).FormulaLocal = vergleich(j)(0)
.getCellByPosition(1, k).FormulaLocal = vergleich(j)(1)
k = k + 1
Exit For
End If
Next j
Next i
End With
Msgbox "Fertig"
End Sub
Gruß
Stephan