0
Excel 2007.
I want a macro to put today's date in the current cell formatted as dd-mmm-yy, e.g. 30-Oct-14.
The code I have is simple :
'ActiveCell.Value = Format(Now(), "dd-mmm-yy")'
For some reason this returns "30 Oct 14" with spaces instead of hyphens.
Similar formats work correctly. e.g
dd-mm-yy gives 30-10-14,
dd~mmm~yy gives 30~Oct~14
The cells actual value is set to "10 30 2014"
Can anyone give me a simple workaround, and if possible, explain why this is happening?
See https://stackoverflow.com/questions/19781234/how-to-concatenate-datemm-dd-yyyy-with-time-hhmmss-using-vba/19784256#19784256
– rakslice – 2014-10-30T06:43:11.880