re,
il y avait une faute dedans
Sub Trier()
With Sheets("test")
If .ProtectContents And Not .ProtectionMode Then ' peut VBA tout faire dans cette feuille protégée ?
.Unprotect "Mot de Passe"
.Protect "Mot de Passe", userinterfaceonly:=True '1 permission pour toute cette session pour VBA !
End If
With .Range("A1").CurrentRegion
.Sort .Range("E1"), xlAscending, , .Range("D1"), xlAscending, .Range("C1"), xlAscending, Header:=xlYes
End With
End With
End Sub
ma première moitié, on peut la deplacer vers "thisworkbook", peut-être plus logic.