Hello Niedermee,
Here is another method. The assumptions are column "C" is empty, the row below the last row with data is empty, and the data is in ascending order as shown.
Sub InsertAfterDup()
Dim DataRng As Range
Dim LR As Long
Dim n As Long
Dim nMax As Variant
Dim Wks As Worksheet
Set Wks = ActiveSheet
Set DataRng = Wks.Range("A1").CurrentRegion
Application.ScreenUpdating = False
Set DataRng = Intersect(DataRng, DataRng.Offset(1, 0))
LR = DataRng.Rows.Count
For n = 2 To LR + 1
If DataRng.Item(n, 1) Like DataRng.Item(n - 1, 1) & "*" Then
nMax = Application.Max(DataRng.Item(n - 1, 2), DataRng.Item(n, 2))
DataRng.Item(n + 1, 1).EntireRow.Insert
DataRng.Item(n + 1, 1) = DataRng(n, 1) & "-max"
DataRng.Item(n + 1, 2) = nMax
LR = LR + 1
n = n + 1
End If
Next n
Application.ScreenUpdating = True
End Sub
Bookmarks