Private Sub Worksheet_Change(ByVal Target As Range)
Dim To_Sort As Boolean
Dim D As Range, F As Range
Dim Lr As Long, I As Long
Set D = Rows.Find("Date de la demande") ' première cellule de la table
Set F = Rows(D.Row).Find("Dossier Fini + Optilog") ' dernière cellule de la 1ere ligne de table
' Dernière ligne de la feuille
Lr = Cells.Find("*", LookIn:=xlFormulas, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Set Colonne = Me.Columns(F.Column).Rows(F.Row + 1 & ":" & Lr)
For I = 1 To Target.Count
If Not Intersect(Target.Cells(I), Colonne) Is Nothing Then To_Sort = True
If To_Sort And I = Target.Count Then
Sort.SortFields.Clear
Sort.SortFields.Add Key:=F, _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With Sort
.SetRange Range(Cells(D.Row , D.Column), Cells(Lr, F.Column))
.Header = xlYes: .MatchCase = False
.Orientation = xlTopToBottom: .SortMethod = xlPinYin
.Apply
End With
End If
Next
End Sub