I am having a problem for a long time now.. I have been trying to find some differences between dates and print the result in minutes. However, my problem is that even if I have added a line of code to convert the cell format to date format dd/mm/yyyy, it doesnt apply for the cells, but only for a part of them. Also, for some, it applies, but it creates the date format mm/dd/yyyy. I really dont what to do. These dates are vlookups from another sheet. So, I even wrote a line of code to transform them in their original sheets too. So , it total, just to be sure, I am making two convertions. My code is given below! please help me :)
Sheets("TMS").Select
lastrow = Range("B" & Rows.Count).End(xlUp).Row
With Range("K2:K" & lastrow)
If Not IsEmpty(Range("K2:K" & lastrow)) Then
.NumberFormat = "mm/dd/yyyy hh:mm"
End If
End With
Sheets("TheTracker").Select
lastrow = Range("B" & Rows.Count).End(xlUp).Row
With Range("AO2:AO" & lastrow)
.Formula = "=VLOOKUP(B2,TMS!B:K,10,FALSE)"
.NumberFormat = "mm/dd/yyyy hh:mm"
.Value = .Value
End With
.NumberFormat = "mm/dd/yyyy hh:mm"???dd/mm/yyyybut your code has.NumberFormat = "mm/dd/yyyy hh:mm". Why doesn't it contains.NumberFormat = "dd/mm/yyyy hh:mm"?