1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Sub Communs()
Set f1 = Sheets("feuil1")
Set f2 = Sheets("feuil2")
Set f3 = Sheets("feuil3")
Set MonDico1 = CreateObject("Scripting.Dictionary")
For Each c In f1.Range("A2:A" & f1.[A65000].End(xlUp).Row)
MonDico1(c & "*" & c.Offset(, 1)) = ""
Next c
Set MonDico2 = CreateObject("Scripting.Dictionary")
For Each c In f2.Range("A2:A" & f2.[A65000].End(xlUp).Row)
tmp = c & "*" & c.Offset(, 1)
If MonDico1.exists(tmp) Then If Not MonDico2.exists(tmp) Then MonDico2(tmp) = ""
Next c
f3.[a:b].ClearContents
f3.[A2].Resize(MonDico2.Count, 1) = Application.Transpose(MonDico2.keys)
Application.DisplayAlerts = False
f3.[A2].CurrentRegion.TextToColumns Destination:=Range("A2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="*", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
End Sub |
Partager