I have a long list of dates (randomly given), and want to extract unique dates after 01.01.2000 from my list using a macro. So far I got this:
Sub unikeVerdier()
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 = ActiveWorkbook.Worksheets("Input_raw data").Range("C7:C10006" & lr)
For i = 1 To UBound(c, 1)
d(c(i, 1)) = 1
Next i
ActiveWorkbook.Worksheets("Usage interm.calc.").Range("B90").Resize(d.Count) = Application.Transpose(d.keys)
End Sub
By applying this I get all the unique values returned at B90 in my desired worksheet. The two problems I can't get around right now is:
1) How can I make the macro so the dates comes out sorted?
2) How can I exclude dates before 01.01.2000 from my list of unique values?
Best regards
Sub unikeVerdier()
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 = ActiveWorkbook.Worksheets("Input_raw data").Range("C7:C10006" & lr)
For i = 1 To UBound(c, 1)
d(c(i, 1)) = 1
Next i
ActiveWorkbook.Worksheets("Usage interm.calc.").Range("B90").Resize(d.Count) = Application.Transpose(d.keys)
End Sub
By applying this I get all the unique values returned at B90 in my desired worksheet. The two problems I can't get around right now is:
1) How can I make the macro so the dates comes out sorted?
2) How can I exclude dates before 01.01.2000 from my list of unique values?
Best regards