Gruppe
Allgemein
Problem
Wenn die Werte in Spalte A und B übereinstimmen, sollen die Daten spaltenweise gesammelt werden.
StandardModule: basMain
Sub Sammeln()
Dim iRow As Integer, iRowL As Integer
Dim iCol As Integer, iAct As Integer
iRowL = Cells(Rows.Count, 1).End(xlUp).Row
For iRow = iRowL To 1 Step -1
iCol = 3
For iAct = iRow - 1 To 1 Step -1
If Cells(iAct, 1) = Cells(iRow, 1) And _
Cells(iAct, 2) = Cells(iRow, 2) Then
Do Until IsEmpty(Cells(iRow, iCol))
Cells(iAct, _
WorksheetFunction.CountA _
(Rows(iAct & ":" & iAct)) + 1) = _
Cells(iRow, iCol)
iCol = iCol + 1
Loop
If iCol > 3 Then Rows(iRow).Delete
Exit For
End If
Next iAct
Next iRow
End Sub