steve400243
Active Member
- Joined
- Sep 15, 2016
- Messages
- 429
- Office Version
- 365
- 2016
- Platform
- Windows
Hello, I want to be able to use this code, or a similar one, to search sheet 1 starting in A2 and searching the entire column for uniques. Then the resulting list to "ANALYSIS" Sheet starting in U4. Thanks for all help provided.
VBA Code:
Option Explicit
Sub GetUniques()
Dim d As Object, c As Variant, i As Long, lr As Long
Set d = CreateObject("Scripting.Dictionary")
lr = Cells(Rows.Count, 1).End(xlUp).Row
c = Range.Sheet1("A2:A" & lr)
For i = 1 To UBound(c, 1)
d(c(i, 1)) = 1
Next i
Range.ANALYSIS("U4").Resize(d.Count) = Application.Transpose(d.keys)
End Sub