Sub test()
Dim Ligne As Long, I As Long, Deb As Long
Deb = Cells(1, 1).End(xlDown).Row - 1
For I = Cells(Rows.Count, 1).End(xlUp).Row + 1 To 1 Step -1
If (Cells(I, 6) = "<tr>" Or Cells(I, 6) = "</tr>") And Cells(I, 6).HasFormula = False Then
Rows(I).Delete
End If
Next I
For I = Cells(Rows.Count, 1).End(xlUp).Row + 1 To Deb Step -1
Debug.Print Cells(I, 1).Row
If (I - 1 - Deb) / 3 = Int((I - 1 - Deb) / 3) Then
If I = Deb + 1 Then
Cells(I, 1).EntireRow.Insert
Cells(I, 6) = "<tr>"
Exit Sub
End If
Cells(I, 1).Resize(2).EntireRow.Insert
If Cells(I + 2, 6) <> "" Then
Cells(I + 1, 6) = "<tr>"
End If
Cells(I, 6) = "</tr>"
End If
Next I
End Sub