Option Explicit
Sub test_fusion()
Fusionne 1
Fusionne 2
End Sub
Sub Fusionne(C As Integer)
Dim I As Integer, L As Integer
Dim Dc As String, Df As String
Application.DisplayAlerts = False
With Sheets("Exemple")
L = .Cells(Rows.Count, C).End(xlUp).Row
Dc = vbNullString
For I = 2 To L + 1
.Cells(I, C).Select
If .Cells(I, C) <> .Cells(I - 1, C) Then
If Dc <> vbNullString Then
With .Range(Dc, Df)
.Select
.Merge
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
End With
End If
Dc = .Cells(I, C).Address
End If
Df = .Cells(I, C).Address
Next
End With
End Sub