recherche double sur 2 classeurs

C

cécile

Guest
bonjour je cherche comment modifier cette macro pour faire la meme chose mais sur deux classeur diff
classeur1 colonne a
classeur2 colonne b
merci de votre aide

Private Sub CommandButton1_Click()

Set RngColA = Range("A2:A50") 'Zone à explorer (Réglable)
Set RngColB = Range("B2:B50") 'Zone à explorer (Réglable)

For Each Cel In Union(RngColA, RngColB)
Cel.Interior.ColorIndex = xlNone
Next Cel

For Each CelA In RngColA
CelA.Interior.ColorIndex = RngColA.Cells(1).Offset(-1, 0).Interior.ColorIndex
For Each CelB In RngColB
If CelA = CelB Then
CelA.Interior.ColorIndex = xlNone
End If
Next CelB
Next CelA

For Each CelB In RngColB
CelB.Interior.ColorIndex = RngColB.Cells(1).Offset(-1, 0).Interior.ColorIndex
For Each CelA In RngColA
If CelB = CelA Then
CelB.Interior.ColorIndex = xlNone
End If
Next CelA
Next CelB

End Sub
 
W

Wilfried

Guest
Salut Cecile,

Tu peut essayer comme suivant :

Set RngColA = WORKBOOk("classeur1").Range("A2:A50") 'Zone à explorer (Réglable)
Set RngColB = WORKBOOk("classeur2").Range("B2:B50") 'Zone à explorer (Réglable)
Il faut que tes deux feuille contenant tes plage est le focus.

A+ Et Bonne Fêtes de fin d'années
 

Discussions similaires

Réponses
2
Affichages
168

Statistiques des forums

Discussions
312 379
Messages
2 087 767
Membres
103 662
dernier inscrit
rterterert