Private Sub Worksheet_Activate()
Dim i&, col As Variant, c As Range
Application.ScreenUpdating = False
Range("A2:V" & Rows.Count).Delete xlUp 'RAZ
With Sheets("LISTE DETAILLE").[A1].CurrentRegion
For i = 2 To .Rows.Count
col = Application.Match("*" & .Cells(i, 2), Rows(1), 0)
If IsNumeric(col) Then
Set c = Cells(Rows.Count, col).End(xlUp)(2)
c = .Cells(i, 1)
c(1, 2) = .Cells(i, 3)
End If
Next
End With
'---bordures---
With [A1].CurrentRegion
.Borders.Weight = xlThin
For col = 1 To .Columns.Count Step 2
.Cells(1, col).Resize(.Rows.Count, 2).BorderAround Weight:=xlMedium 'pourtour
Next
End With
Columns.AutoFit 'ajustement largeurs
End Sub