Gruppe
Allgemein
Problem
Die Zeilen mit Datum und nebenstehendem Text sollen jeweils als Vorgängerspalten zu den darunterstehenden Gruppen angeordnet werden.
StandardModule: Modul1
Sub UmOrdnen()
Dim iRowL As Integer, iRow As Integer
Columns("A:B").Insert
iRowL = Cells(Rows.Count, 3).End(xlUp).Row
For iRow = iRowL To 1 Step -1
If IsEmpty(Cells(iRow, 5)) Then
Range(Cells(iRow + 1, 1), Cells(iRow + 1 + _
WorksheetFunction.CountA(Cells(iRow, 3) _
.CurrentRegion.Columns(1)) - 2, 2)).Value = _
Range(Cells(iRow, 3), Cells(iRow, 4)).Value
Rows(iRow).Delete
iRow = iRow - 1
End If
Next iRow
End Sub