Bonjour,
comme l'indique le message d'erreur, tu ne peux pas modifier une cellule qui est la cible d'une fonction matricielle.
une solution possible, mais avec l'inconvénient que tu perds ta formule
Sub triligne()
With ActiveWorkbook.Worksheets("planning")
.Range("B1:AJ1").Copy
.Range("B1:AJ1").PasteSpecial Paste:=xlPasteValues 'enlever la formule matricielle, ne garder que le résultat
With .Sort
.SortFields.Clear
.SortFields.Add Key:=Range("B1:AJ1"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SetRange Range("B1:AJ1")
.Header = xlGuess
.MatchCase = False
.Orientation = xlLeftToRight
.SortMethod = xlPinYin
.Apply
End With
End With
End Sub