On 2002-10-18 05:19, Andrew Poulsom wrote:
Excel and bl**dy UK/European dates!
It's because today minus 6 is 12th October. In dd/mm format that's 12/10 but Excel gets confused about what is the day and what is the month and returns 10th December.
I've tried lots of things and the only solution I have found is:
Code:
Sub Test()
Range("G1").Value = Date - Range("G2").Value
Range("G1").NumberFormat = "dd/mm/yyyy"
End Sub
This is not good, because one should be able to use the named format "Short Date" to ensure international compatibility. That's why it exists.