Je demande de l'aide, en tant qu'autodidacte débutant, pour finir ce classement par date une fois la ligne complétée.
Je vous mets en copie le code VBA que j'ai fait et le tableau en question. Où se trouve l'erreur ?
Merci
Sub tri()
Application.ScreenUpdating = False
With Sheets("Janvier").Sort
.SortFields.Clear
.SortFields.Add Key:=Range("A5"), Order:=xlAscending
.SetRange Range("A5:E150")
.Apply
End With
Application.ScreenUpdating = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A5:E150")) Is Nothing Then
iRow = Target.Row
'recherche si toutes les cellules de la ligne sont complétées
For x = 1 To 5
If Cells(iRow, x) = "" Then Exit Sub
Next
Call tri
End If
End Sub