Mon probl=E8me est tr=E8s certainement tout simple pour vous, mais moi je
nage compl=E8tement
Il s'agit de :
Chercher si les valeurs de type date contenues dans le tab1 ZoneA (1
seule colonne)
existent dans le tab2 ZoneB (plusieurs colonnes)
Si c'est le cas, applique =E0 ces valeurs du tab2 ZoneB le style "cal1"
J'ai cherch=E9 une macro d=E9j=E0 existante sur le site, mais n'ai rien
trouv=E9. Vous devez bien avoir =E7=E0 quelque part
Function Communs(champ1, champ2) Set MonDico1 = CreateObject("Scripting.Dictionary"); For Each c In champ1 If Not MonDico1.Exists(c.Value) Then MonDico1.Add c.Value, c.Value Next c Set mondico2 = CreateObject("Scripting.Dictionary"); For Each c In champ2 If MonDico1.Exists(c.Value) Then If Not mondico2.Exists(c.Value) Then mondico2.Add c.Value, c.Value End If Next c i = 1 Communs = Application.Transpose(mondico2.items) End Function
=communs(A2:A12;C2:C12) Valider avec Maj+ctrl+entrée
Function Communs(champ1, champ2)
Set MonDico1 = CreateObject("Scripting.Dictionary");
For Each c In champ1
If Not MonDico1.Exists(c.Value) Then MonDico1.Add c.Value, c.Value
Next c
Set mondico2 = CreateObject("Scripting.Dictionary");
For Each c In champ2
If MonDico1.Exists(c.Value) Then
If Not mondico2.Exists(c.Value) Then mondico2.Add c.Value,
c.Value
End If
Next c
i = 1
Communs = Application.Transpose(mondico2.items)
End Function
=communs(A2:A12;C2:C12)
Valider avec Maj+ctrl+entrée
Function Communs(champ1, champ2) Set MonDico1 = CreateObject("Scripting.Dictionary"); For Each c In champ1 If Not MonDico1.Exists(c.Value) Then MonDico1.Add c.Value, c.Value Next c Set mondico2 = CreateObject("Scripting.Dictionary"); For Each c In champ2 If MonDico1.Exists(c.Value) Then If Not mondico2.Exists(c.Value) Then mondico2.Add c.Value, c.Value End If Next c i = 1 Communs = Application.Transpose(mondico2.items) End Function
=communs(A2:A12;C2:C12) Valider avec Maj+ctrl+entrée