hi, I am trying to populate a drop down box with a column of dates and only want to populate unique values. I have tried the following code but it doesn't work. Can anyone please assist?
Sub FilterUniqueData()
Dim Lrow As Long, test As New Collection
Dim Value As Variant, temp() As Variant
ReDim temp(0)
On Error Resume Next
With ActiveSheet
Lrow = .Range("C" & Rows.Count).End(xlUp).Row
temp = .Range("C10:C" & Lrow).Value
End With
For Each Value In temp
If Len(Value) > 0 Then test.Add Value, CStr(Value)
Next Value
ActiveSheet.Shapes("Drop Down 6").ControlFormat.RemoveAllItems
For Each Value In test
ActiveSheet.Shapes("Drop Down 6").ControlFormat.AddItem Value
Next Value
Set test = Nothing
End Sub