Sub main()
Set dic = CreateObject("scripting.dictionary") '定義字典
x = Range("B65536").End(3).Row '將B列最大非空行號賦值給x
For i = 2 To x
dic(Cells(i, "B").Value) = "" '將B列全部放入字典中
Next i
For i = 2 To Range("A65536").End(3).Row '從A2到最後壹個非空單元格循環
If dic.eixsts(Cells(i, "A").Value) = False Then '如果字典中不存在A列的值
x = x + 1 'x增加1
Cells(x, "B") = Cells(i, "A") '將A列的值賦予B列最後的單元格中
End If
Next i
End Sub