Sub Classement_colonnes()
Dim chemin$, dest As Worksheet, source As Worksheet, col%, i As Variant
chemin = ThisWorkbook.Path & "\" 'à adapter
Application.ScreenUpdating = False
Application.DisplayAlerts = False 'si un fichier est déjà ouvert
Set dest = Workbooks.Open(chemin & "B.xlsx").Sheets(1)
Set source = Workbooks.Open(chemin & "A.xlsx").Sheets(1)
With dest.UsedRange
.Rows(1).Insert xlDown
For col = 1 To .Columns.Count
i = Application.Match(.Cells(1, col), source.UsedRange.Rows(1), 0)
If IsNumeric(i) Then .Cells(0, col) = i
Next
Union(.Rows(0), .Cells).Sort .Rows(0), xlAscending, Orientation:=2 'tri horizontal
.Rows(0).Delete xlUp
End With
End Sub