Forumbeitrag
Excel-Version des Fragestellers:
2022
Erfahrungslevel des Fragestellers:
Basiskenntnisse in Excel
Oder so:
Sub M_snb()
sn = Tabelle1.Cells(8, 1).CurrentRegion.Resize(, 16)
sp = Tabelle2.Cells(4, 1).CurrentRegion.Resize(, 30)
With CreateObject("scripting.dictionary")
For j = 2 To UBound(sp)
.Item(sp(j, 1)) = .Item(sp(j, 1)) & "|" & sp(j, 30)
Next
For j = 3 To UBound(sn)
st = Split(.Item(sn(j, 1)), "|")
For jj = 0 To UBound(st)
If j + jj <= UBound(sn) Then If sn(j + jj, 1) = sn(j, 1) Then sn(j + jj, 16) = st(jj + 1)
Next
If UBound(st) > 0 Then j = j + jj - 2
Next
End With
Tabelle1.Cells(8, 1).CurrentRegion.Resize(, 16) = sn
End Sub