I'd use:
Sub M_snb()
sn = Sheets("before").Cells(1).CurrentRegion
With CreateObject("scripting.dictionary")
For j = 2 To UBound(sn)
y = 0
For jj = 7 To UBound(sn, 2) - 1
If Abs(jj * (sn(j, jj) <> "")) > y Then y = jj
Next
If y > .Item(sn(j, 1) & sn(j, 3)) Then
.Item(sn(j, 1) & sn(j, 3)) = y
.Item(sn(j, 1) & sn(j, 3) & "_") = Application.Index(sn, j)
End If
Next
sp = Filter(.keys, "_", 0)
For Each it In sp
.Remove it
Next
Sheets("after").Cells(60, 1).Resize(.Count, UBound(sn, 2)) = Application.Index(.items, 0, 0)
End With
End Sub