Oder so:
PHP-Code:
Sub M_snb()
ReDim sq(100, 3)
ReDim st(100, 1)
y = 0
For j = 1 To 2
sn = Choose(j, Tabelle2.Range("C9:O100"), Tabelle3.Range("C17:Q100"))
For jj = 1 To UBound(sn)
If Trim(sn(jj, 1)) <> "" Then sq(y, 0) = sn(jj, 1)
If Trim(sn(jj, 2)) <> "" Then
sq(y, 1) = sn(jj, 2)
sq(y, 2) = "Quelle " & j
sq(y, 3) = sn(jj, 9 + 2 * j)
st(y, 0) = sn(jj, 15 - 2 * j)
st(y, 1) = sn(jj, 9 + 3 * j)
y = y + 1
sq(y, 0) = sq(y - 1, 0)
End If
Next
Next
sq(y, 0) = ""
Tabelle1.Cells(11, 3).Resize(UBound(sq), UBound(sq, 2) + 1) = sq
Tabelle1.Cells(11, 13).Resize(UBound(st), UBound(st, 2) + 1) = st
End Sub