Re : Excel vba erreur d'exécution
Bonjour Pierrot93
Merci pour ta réponse cela fontionne, seul inconvéniant c'est que la macro se termine alors qu'il faudrait qu'elle reprenne à la ligne rouge
Cordialement
Laraviole
If Application.CountA(Range("O2
2")) = 0 Then Exit Sub
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
'Range(Selection, Selection.End(xlDown)).Select
'Selection.Copy
Windows("Histo_Doublons.xls").Activate
Range("A65535").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Range("C2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("C2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=RC[-2]&RC[-1]"
If [B65536].End(xlUp).Row > 1 Then _
Range("C2").AutoFill Destination:=Range("C2:C" & Range("B65536").End(xlUp).Row)
Range("A1").Select
ActiveWorkbook.Save
Windows("Doublons_Diffusion.xls").Activate Range("A1").Select
Sheets(Array("Feuil2", "Feuil3")).Select
Sheets("Feuil3").Activate
ActiveWindow.SelectedSheets.Delete
Sheets("Feuil1").Select
Sheets("Feuil1").Name = "Doublons"
Range("A1").Select
ActiveWorkbook.Save
ActiveWindow.Close
ActiveWindow.Close
Selection.AutoFilter
Range("A1").Select
ActiveWindow.Close
Range("A1").Select
Application.DisplayAlerts = True
MsgBox ("Traitement des doublons terminé")
End Sub