I am newer to understanding macros. I was able to partially reach a solution.
Instead of 'Printing Unique Values to the Immediate window in VBA (which does show the unique values I need it to), I would like the unique values pasted to my "Macros" worksheet starting in cell F7. This is a dynamic range so I know my starting cell of F7, but I do not know how many unique values will be found when the code is run.
How would I paste these values? Thank you for your help!
Sub UniqueContracts()
Dim Arr As New Collection, a
Dim Item As Variant
Dim vRng As Range
Lr = Worksheets("Original").Cells(Rows.Count, "I").End(xlUp).Row 'Range Last Row
Set vRng = Worksheets("Original").Range("I2:I" & Lr)
If vRng.Count > 0 Then
'---Making Unique Values
On Error Resume Next
For Each a In vRng
Arr.Add a, a
Next
On Error GoTo 0
'---Printing Unique Values
For Each Item In Arr
Debug.Print Item
Next Item
End If
End Sub
Bookmarks