Je recherche une macro qui me supprimeras toutes les lignes 100% identiques,
@+
Romeo59181
FFO
Salut à toi
Ce code fonctionne mais peut avoir un traitement long en fonction du nombre de lignes à traiter et du nombre de doublons (pour 20000 lignes toutes en doublon 1m30s) :
Range("A" & Range("A2").SpecialCells(xlCellTypeLastCell).Row).Activate Do While ActiveCell.Offset(-i, 0).Row > 1 For j = 1 To 255 If Cells(ActiveCell.Offset(-i, 0).Row, j) <> Cells(ActiveCell.Offset(-i, 0).Row - 1, j) Then Divergence = 1 Exit For End If Next If Divergence <> 1 Then ActiveCell.Offset(-i, 0).EntireRow.Clear End If Divergence = "" i = i + 1 Loop Range("A2", "A" & Range("A2").SpecialCells(xlCellTypeLastCell).Row).EntireRow.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal
Fais des essais et dis moi !!!!
Salut à toi
Ce code fonctionne mais peut avoir un traitement long en fonction du nombre
de lignes à traiter et du nombre de doublons (pour 20000 lignes toutes en
doublon 1m30s) :
Range("A" & Range("A2").SpecialCells(xlCellTypeLastCell).Row).Activate
Do While ActiveCell.Offset(-i, 0).Row > 1
For j = 1 To 255
If Cells(ActiveCell.Offset(-i, 0).Row, j) <> Cells(ActiveCell.Offset(-i,
0).Row - 1, j) Then
Divergence = 1
Exit For
End If
Next
If Divergence <> 1 Then
ActiveCell.Offset(-i, 0).EntireRow.Clear
End If
Divergence = ""
i = i + 1
Loop
Range("A2", "A" &
Range("A2").SpecialCells(xlCellTypeLastCell).Row).EntireRow.Sort
Key1:=Range("A2"), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Ce code fonctionne mais peut avoir un traitement long en fonction du nombre de lignes à traiter et du nombre de doublons (pour 20000 lignes toutes en doublon 1m30s) :
Range("A" & Range("A2").SpecialCells(xlCellTypeLastCell).Row).Activate Do While ActiveCell.Offset(-i, 0).Row > 1 For j = 1 To 255 If Cells(ActiveCell.Offset(-i, 0).Row, j) <> Cells(ActiveCell.Offset(-i, 0).Row - 1, j) Then Divergence = 1 Exit For End If Next If Divergence <> 1 Then ActiveCell.Offset(-i, 0).EntireRow.Clear End If Divergence = "" i = i + 1 Loop Range("A2", "A" & Range("A2").SpecialCells(xlCellTypeLastCell).Row).EntireRow.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal
Fais des essais et dis moi !!!!
romeo59181
Bonjour,
Voici le message délivré :
Instruction incorrecte à intérieur d'une procédure
@+
Romeo59181
"FFO" a écrit dans le message de groupe de discussion :
Salut à toi
Ce code fonctionne mais peut avoir un traitement long en fonction du nombre de lignes à traiter et du nombre de doublons (pour 20000 lignes toutes en doublon 1m30s) :
Range("A" & Range("A2").SpecialCells(xlCellTypeLastCell).Row).Activate Do While ActiveCell.Offset(-i, 0).Row > 1 For j = 1 To 255 If Cells(ActiveCell.Offset(-i, 0).Row, j) <> Cells(ActiveCell.Offset(-i, 0).Row - 1, j) Then Divergence = 1 Exit For End If Next If Divergence <> 1 Then ActiveCell.Offset(-i, 0).EntireRow.Clear End If Divergence = "" i = i + 1 Loop Range("A2", "A" & Range("A2").SpecialCells(xlCellTypeLastCell).Row).EntireRow.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal
Fais des essais et dis moi !!!!
Bonjour,
Voici le message délivré :
Instruction incorrecte à intérieur d'une procédure
@+
Romeo59181
"FFO" <FFO@discussions.microsoft.com> a écrit dans le message de groupe de
discussion : 4A701DCF-CB8A-4153-8649-5DC1A70E412D@microsoft.com...
Salut à toi
Ce code fonctionne mais peut avoir un traitement long en fonction du
nombre
de lignes à traiter et du nombre de doublons (pour 20000 lignes toutes en
doublon 1m30s) :
Range("A" & Range("A2").SpecialCells(xlCellTypeLastCell).Row).Activate
Do While ActiveCell.Offset(-i, 0).Row > 1
For j = 1 To 255
If Cells(ActiveCell.Offset(-i, 0).Row, j) <> Cells(ActiveCell.Offset(-i,
0).Row - 1, j) Then
Divergence = 1
Exit For
End If
Next
If Divergence <> 1 Then
ActiveCell.Offset(-i, 0).EntireRow.Clear
End If
Divergence = ""
i = i + 1
Loop
Range("A2", "A" &
Range("A2").SpecialCells(xlCellTypeLastCell).Row).EntireRow.Sort
Key1:=Range("A2"), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Instruction incorrecte à intérieur d'une procédure
@+
Romeo59181
"FFO" a écrit dans le message de groupe de discussion :
Salut à toi
Ce code fonctionne mais peut avoir un traitement long en fonction du nombre de lignes à traiter et du nombre de doublons (pour 20000 lignes toutes en doublon 1m30s) :
Range("A" & Range("A2").SpecialCells(xlCellTypeLastCell).Row).Activate Do While ActiveCell.Offset(-i, 0).Row > 1 For j = 1 To 255 If Cells(ActiveCell.Offset(-i, 0).Row, j) <> Cells(ActiveCell.Offset(-i, 0).Row - 1, j) Then Divergence = 1 Exit For End If Next If Divergence <> 1 Then ActiveCell.Offset(-i, 0).EntireRow.Clear End If Divergence = "" i = i + 1 Loop Range("A2", "A" & Range("A2").SpecialCells(xlCellTypeLastCell).Row).EntireRow.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:úlse, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal
Fais des essais et dis moi !!!!
FFO
Rebonjours à toi
Je pense que tu as mal recopié le code Des lignes d'instructions ont été scindées à la recopie Il faut les remettre sur une seule ligne
Avec ce lien tu peux récupérer un exemple Actives la macro "Traitement" et vérifies le résultat