1 2 3 4 5 6 7 8 9 10 11 12
| Sub Demo1()
Const F = "TRANSPOSE(IF(#1>"""",IF(COUNTIF(#2,#1)=0,#1)))", J = ""","""
With Cells(1).CurrentRegion.Columns
S$ = Join(Filter(Evaluate(Replace$(Replace$(F, "#1", .Item(1).Address), "#2", .Item(2).Address)), False, False), J)
T$ = Join(Filter(Evaluate(Replace$(Replace$(F, "#1", .Item(2).Address), "#2", .Item(1).Address)), False, False), J)
End With
If S > "" Then S = """" & S & """"
If T > "" Then T = """" & T & """"
Cells(4).CurrentRegion.Clear
VA = Evaluate("TRANSPOSE({" & S & IIf(S > "" And T > "", ",", "") & T & "})")
If Not IsError(VA) Then Cells(4).Resize(UBound(VA)).Value = VA
End Sub |
Partager