Forum Discussion
shetzel
Sep 16, 2020Brass Contributor
Changing date format
I am getting my dates in this format, 2020-09-15 and would like to convert to 09/15/2020, is there a way to do that. I tried all options I have under custom format, but nothing worked. I have attache...
Rajesh_Sinha
Sep 17, 2020Iron Contributor
shetzel ,,,
I've examined the attached sheet,, and got the basic mistake probably you have committed,,, since Date in column N & O are Left Aligned,, mean Excel considered as TEXT,,, perhaps initially Cell Format was TEXT, and you have entered the Dates,, the tried to apply the required Date Format,, and because cell are TEXT,, so that Excel has rejected the new Date Format.
The possible solution is re-write the Date in cells,, but are many so, I would like to suggest simple VBA Macro.
Sub test( )
Application.ActiveWorkbook.Worksheets("Weekly Data").Range("N3:N322") = Format(Date, "mm/dd/yyyy")
Application.ActiveWorkbook.Worksheets("Weekly Data").Range("O3:O322") = Format(Date, "mm/dd/yyyy")
End Sub
N. B. Check the attached Workbook.