Hi wyndham29,
Here's my attempt which also takes into account your request to ignore cells with commas and has some commentary about what the code is doing:
Option Explicit
Sub Macro1()
Dim rngCell As Range
Dim clnUniqueValues As New Collection
Application.ScreenUpdating = False
For Each rngCell In Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row) 'Starts at roe Row 2 of Col. A. Change to suit.
If InStr(rngCell, ",") = 0 Then 'Only run the following code if the cell doesn't have a comma in it.
On Error Resume Next 'Turn error reporting off as we're not interested in the 'Run-time error '457' This key is already associated with an element of this collectopn' error message as we only want unique entries anyway.
clnUniqueValues.Add rngCell.Value, CStr(rngCell.Value)
If Err.Number = 0 Then
Range("B" & Rows.Count).End(xlUp).Offset(1, 0).Value = rngCell 'Puts each unique item in Col. A into the next available Row of Col. B. Change to suit.
End If
Err.Clear
On Error GoTo 0
End If
Next rngCell
Application.ScreenUpdating = True
End Sub
Regards,
Robert
Bookmarks