|
私も参考になればと言うレベルですが。
1行目は項目行扱いとしてます。
Sub test()
Dim Dic As Object
Dim a, b, v, vv
Dim i As Long
Set Dic = CreateObject("Scripting.Dictionary")
i = 2
With Worksheets("Sheet1")
v = .Range(.[A2], .Cells(Rows.Count, 1).End(xlUp)).Value
For Each vv In v
Dic(vv) = Empty
Next
.Range("C:D").ClearContents
a = .Range(.[B2], .Cells(Rows.Count, 2).End(xlUp)).Value
For Each b In a
If Not Dic.exists(b) Then
.Range("C" & i).Value = b
i = i + 1
Else
Dic.Remove (b)
End If
Next
.Range("D2").Resize(Dic.Count).Value = Application.Transpose(Dic.keys)
.Range("C1").Resize(, 2).Value = [{"追加No.","削除No."}]
End With
End Sub
(ご希望にあっているかは不安ですけど)
|
|