bonjour,
dans ma macro de doublons sur plusieurs feuilles j'ai un problème de dépassement de capacité erreur 6
pas moyens de trouver le problème
c'est a cette ligne que cela se produit
If Application.CountIf(Plage_A, Cel.Value) > 0 Then Cel.Interior.ColorIndex = 26
merci d'avance
cordialement
Sub essai()
Dim Fe As Worksheet
Dim Plage_A As Range
Dim Plage_N As Range
Dim Cel As Range
Application.ScreenUpdating = False
'défini la plage en colonne A de feuille "Feuil1"
With Worksheets("Feuil1")
Set Plage_A = .Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp))
End With
For Each Fe In Worksheets
If Fe.Name <> "Feuil4" And Fe.Name <> "Feuil5" Then
'défini la plage en colonne N de la feuille en cours
With Fe
Set Plage_N = .Range(.Cells(1, 12), .Cells(.Rows.Count, 12).End(xlUp))
End With
'boucle sur la plage
For Each Cel In Plage_N
If Application.CountIf(Plage_A, Cel.Value) > 0 Then Cel.Interior.ColorIndex = 26
Next Cel
End If
Next Fe
End Sub