Private Sub Worksheet_Activate()
Dim n As Byte, i As Variant, j As Variant
Application.ScreenUpdating = False
For n = 1 To 13 'à adapter éventuellement
i = Application.Match("*(" & n & ")", [B:B], 0)
If IsNumeric(i) Then
j = Application.Match("TOTAL*", Range(Cells(i + 1, 2), Range("B" & Rows.Count)), 0)
If IsNumeric(j) Then
If j > 3 Then Rows(i + 2).Resize(j - 3).Delete 'RAZ
With Sheets("juin")
For j = .Range("B" & .Rows.Count).End(xlUp).Row To 11 Step -1
If .Cells(j, 2) = n Then
Rows(i + 2).Insert
Cells(i + 2, 2) = .Cells(j, 3)
Cells(i + 2, 3) = .Cells(j, 4)
Cells(i + 2, 4) = .Cells(j, 5)
Cells(i + 2, 3).Resize(, 2).NumberFormat = "#,###.00 €" 'au cas où
End If
Next
End With
End If
End If
Next
End Sub