Re : trier des donnees par colonne a l'ouverture d'un classeur
J'ai essayer sa: mais sa marque une erreur : ext without for
Sub creationsliens()
Sheets("DONNEE").Range("G2:AM595").ClearContents
Dim Col As Integer, Lig As Long, DerliG As Long
For Col = 1 To 33
For Lig = 2 To 595
' Colonne AP = 42 ème / G = 7ème
With Sheets("DONNEE") If Cells(Lig, 41 + Col) <> "" Then
DerliG = Cells(Rows.Count, 6 + Col).End(xlUp).Row
Cells(DerliG + 1, 6 + Col) = Cells(Lig, 41 + Col)
End If
Next Lig
Next Col
End Sub
et j'ai essayer sa : mais cela ne change rien
Sub creationsliens()
Sheets("DONNEE").Range("G2:AM595").ClearContents
Dim Col As Integer, Lig As Long, DerliG As Long
For Col = 1 To 33
For Lig = 2 To 595
' Colonne AP = 42 ème / G = 7ème
If Sheets("DONNEE").Cells(Lig, 41 + Col) <> "" Then
DerliG = Cells(Rows.Count, 6 + Col).End(xlUp).Row
Cells(DerliG + 1, 6 + Col) = Cells(Lig, 41 + Col)
End If
Next Lig
Next Col
End Sub
PS: Moi j'ai besoin d'un code ou je ne suis pas obliger d'ouvrir la feuille donnee
merci de ta patience