KTM
XLDnaute Impliqué
Bonsoir Cher Forum
Je voudrais faire un tri de mes données et j'ai élaboré ce code:
Mais il ya erreur lorsque ma plage A4:A14 ne contient pas 0
Je voudrais faire un tri de mes données et j'ai élaboré ce code:
VB:
Sub TRIER()
Dim Lig As Variant
Lig = Application.Match(0, Range("A4:A14"), 0) + 2
If IsError(Lig) Then
Range("E1").Value = 14
Range("A4:D14").Sort Key1:=Range("A4"), Order1:=xlAscending
Else
Range("E1").Value = Lig
Range("A4:D" & Lig).Sort Key1:=Range("A4"), Order1:=xlAscending
End If
End Sub
Mais il ya erreur lorsque ma plage A4:A14 ne contient pas 0