Gruppieren
Ludwig50
vielleicht kann mir jemand bei meinem Problem helfen.
Ich möchte das Bereiche mit gleichen Zahlen per VBA gruppiert werden.
Sie nachfolgenden Code und Mustertabelle.
Danke
Gruß
Ludwig
https://www.herber.de/bbs/user/74021.xlsm
Sub Gruppieren()
Dim iRowL As Integer, iRow As Integer
Dim wks As Object
Set wks = Worksheets("T1")
Application.ScreenUpdating = False
With wks
iRowL = .Cells(Rows.Count, 1).End(xlUp).Row
For iRow = 8 To iRowL
If .Cells(iRow, 1).Value "" _
And .Cells(iRow, 5).Value = .Cells(iRow, 1).Value Then
Range(.Cells(iRow, 1), .Cells(iRow, 5)).Select
Selection.Rows.Group
End If
Next iRow
End With
Application.ScreenUpdating = True
End Sub