je ne vois pas ou est l'erreur

Bruce sato

XLDnaute Nouveau
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
derligneA = Range("A65500").End(xlUp).Row + 1
If Range("J27") <> "" Then
Range("F" & derligneA) = Range("J32")
Range("E" & derligneA) = Range("J31")
Range("D" & derligneA) = Range("J30")
Range("C" & derligneA) = Range("J29")
Range("B" & derligneA) = Range("J28")
Range("A" & derligneA) = Range("J27")
End If
Range("J28:J32").ClearContents
Columns("A:F").Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("J19").Select
Application.ScreenUpdating = True
End Sub
 
Dernière édition:

Pierrot93

XLDnaute Barbatruc
Re : je ne vois pas ou est l'erreur

Re Bruce

merci pour mes yeux, essaye peut être en modifiant comme suit, si la ligne 1 contient les titres et aucune donnée après colonne F :

Code:
Range("a1").CurrentRegion.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

@+
 

Discussions similaires

Statistiques des forums

Discussions
312 763
Messages
2 091 858
Membres
105 079
dernier inscrit
Biscot_399