Bonjour,
on m'a aide il y a quelques temps; on m'a donne un code qui marche bien:
Sub eliminer_non_erreur()
Dim plage As Range
Dim Ligne As Long, cpt As Long
'On Error GoTo FinSuppr
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
LigSource = Sheets(2).Range("B" & Rows.Count).End(xlUp).Row
LigCible = Sheets(1).Range("A" & Rows.Count).End(xlUp).Row + 5 ' + 5
Sheets(2).Range("B6:B" & LigSource).Copy Sheets(1).Range("A" & LigCible)
With ActiveSheet
Set plage = .Range("A3:A" & .Range("A" & Rows.Count).End(xlUp).Row)
cpt = plage.Rows.Count
For Ligne = cpt To 1 Step -1
If Application.CountIf(plage, plage.Cells(Ligne, 1)) = 1 Then
plage.Cells(Ligne, 1).EntireRow.Delete
End If
Next Ligne
End With
Application.ScreenUpdating = True
End Sub
-----------------------
Toutefois, j'ai un long fichier et la macro a pris un temps bien trop long
Je vous met le fichier ci joint si vous voulez faire une simulation
Auriez vous des idees pour que la macro puisse etre bien plus rapide?
peut etre faut il changer le code ?
Merci de votre aide
on m'a aide il y a quelques temps; on m'a donne un code qui marche bien:
Sub eliminer_non_erreur()
Dim plage As Range
Dim Ligne As Long, cpt As Long
'On Error GoTo FinSuppr
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
LigSource = Sheets(2).Range("B" & Rows.Count).End(xlUp).Row
LigCible = Sheets(1).Range("A" & Rows.Count).End(xlUp).Row + 5 ' + 5
Sheets(2).Range("B6:B" & LigSource).Copy Sheets(1).Range("A" & LigCible)
With ActiveSheet
Set plage = .Range("A3:A" & .Range("A" & Rows.Count).End(xlUp).Row)
cpt = plage.Rows.Count
For Ligne = cpt To 1 Step -1
If Application.CountIf(plage, plage.Cells(Ligne, 1)) = 1 Then
plage.Cells(Ligne, 1).EntireRow.Delete
End If
Next Ligne
End With
Application.ScreenUpdating = True
End Sub
-----------------------
Toutefois, j'ai un long fichier et la macro a pris un temps bien trop long
Je vous met le fichier ci joint si vous voulez faire une simulation
Auriez vous des idees pour que la macro puisse etre bien plus rapide?
peut etre faut il changer le code ?
Merci de votre aide