Skip to content

Instantly share code, notes, and snippets.

@DuongAQ
Created February 10, 2018 05:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DuongAQ/1e312b3a5a81f0f35b3287598641c8da to your computer and use it in GitHub Desktop.
Save DuongAQ/1e312b3a5a81f0f35b3287598641c8da to your computer and use it in GitHub Desktop.
Sub Loc_Khong_Trung_02()
Dim ar As Variant
Dim var()
Dim i As Long
Dim n As Long
ar = Range("A1").CurrentRegion 'Vị trí bắt đầu trong bảng dữ liệu
ReDim var(1 To UBound(ar, 1), 1 To 1)
With CreateObject("scripting.dictionary")
.comparemode = 1
For i = 1 To UBound(ar, 1)
.Item(ar(i, 2)) = Empty
Next
For i = 1 To UBound(ar, 1)
If Not .exists(ar(i, 1)) Then
n = n + 1
var(n, 1) = ar(i, 1)
End If
Next
End With
[E1].Resize(n).Value = var 'Vị trí trích xuất kết quả so sánh
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment