Sub Macro1()
codeclient = Range("A2").Value
i = 3
Do While i <= [A65000].End(xlUp).Row
lignedebut = i - 1
lignefin = i - 1
Do While codeclient = Range("A" & i)
lignefin = lignefin + 1
i = i + 1
Loop
codeclient = Range("A" & i).Value
If lignedebut <> lignefin Then
justDOit = False
Application.DisplayAlerts = False
For col = 1 To 9
Select Case col
Case 1
Range(Cells(lignedebut, col), Cells(lignefin, col)).Select
Selection.Merge
Case 2 To 8
If Not justDOit Then
sauveTexte = ""
For coll = 2 To 8
For lig = lignedebut To lignefin
sauveTexte = sauveTexte & Cells(lig, coll) & vbCrLf
Next lig
Range(Cells(lignedebut, coll), Cells(lignefin, coll)).Select
Selection.Merge
Selection.Value = sauveTexte
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = True
End With
sauveTexte = ""
justDOit = True
Next coll
End If
Case 9
Range(Cells(lignedebut, col), Cells(lignefin, col)).Select
Selection.Merge
End Select
Next col
i = i + 1
Else
i = i + 1
End If
Loop
End Sub