Date conversion problem using Excel VBA

0

Hi, I'm doing a macro that changes a whole column that is dated dd.mm.yyyy to dd-mm-yyy, and I used the following command:

Range("E:E).Select
Selection.Replace What:=".", Replacement:="-", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False
Selection.NumberFormat = "dd-mm-yyyy"

However, when transcribing it, it reverses me the day with the month, I also tried with the code:

Range("E:E).Select
Selection.NumberFormat = "@"
Selection.Replace What:=".", Replacement:="-", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False

and I'm still doing the same. The solution to change it one cell at a time is good, in this case it does not help much because there are so many data and it takes a long time. So if someone has a way of doing it by replacing all the values as I do above, it would be very helpful.

    
asked by Cristobal 14.11.2018 в 20:16
source

0 answers