Oh... I forgot about the white spaces
use
![]()
Option Explicit Sub ptestu() Dim p!, i!, k(), e With Range("a1", Range("a" & Rows.Count).End(xlUp)).Resize(, 1) e = .Value End With ReDim k(UBound(e, 1), 1) With CreateObject("Scripting.Dictionary") .CompareMode = vbTextCompare For i = 1 To UBound(e, 1) If Not IsEmpty(e(i, 1)) Then e(i, 1) = Trim(e(i, 1)) If Not .exists(e(i, 1)) Then k(p, 0) = e(i, 1) .Add e(i, 1), p p = p + 1 End If End If Next End With Range("B1").Resize(p, 1).Value = k End Sub
Bookmarks