I have a column which I formated in the following way:
Range("A:A").NumberFormat = "dd.mm.yyyy"
Now, I am looking for an efficient version for this:
For k = 1 To Range("A1").End(xlDown).Row
' from first to last row
Cells(k, 1).Value = CDate(Cells(k, 1).Value)
Next k
This takes forever ;( Does someone know an efficient solution? Thanks!!!
Why do I need this? When running:
With ws.Sort
.SortFields.Add Key:=Range("A1"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SetRange Range("A1", Range("A1").End(xlDown))
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
I got strange sorting like:
01.01.2021
01.02.2021
01.03.2021
02.01.2021