Bonjour,
La fusion de cellules est l'ennemi d'une base de données !
Mais ...
Sub test()
Dim noL As Long, drL As Long, pLJ As Long, pLK As Long
Dim vcJ As Variant, fcJ As String, vcK As Variant, fcK As String
Application.ScreenUpdating = False
With Worksheets("Histo")
drL = .Cells(Rows.Count, "A").End(xlUp).Row
pLJ = 4: pLK = 4
vcJ = .Cells(pLJ, "J").Value: vcK = .Cells(pLJ, "K").Value
fcJ = .Cells(pLJ, "J").Formula: fcK = .Cells(pLJ, "K").Formula
For noL = 4 To drL
If .Cells(noL + 1, "J").Value <> vcJ Then
With .Range(.Cells(pLJ, "J"), .Cells(noL, "J"))
.ClearContents
.Merge
.Formula = fcJ
End With
pLJ = noL + 1
vcJ = .Cells(pLJ, "J").Value
fcJ = .Cells(pLJ, "J").Formula
End If
If .Cells(noL + 1, "J").Value <> vcJ Or _
.Cells(noL + 1, "K").Value <> vcK Then
With .Range(.Cells(pLK, "K"), .Cells(noL, "K"))
.ClearContents
.Merge
.Formula = fcK
End With
pLK = noL + 1
vcK = .Cells(pLK, "K").Value
fcK = .Cells(pLK, "K").Formula
End If
Next noL
End With
End Sub