So I have a date that is 20170529 but whenever I try to format it to a date, the cell just becomes #########. So normally, that means the column width is too small, but even
from format cell choose from category choose date and choose which type you want
Select the cells you wish to fix and run this short macro:
Sub INeedADate()
Dim r As Range
For Each r In Selection
v = r.Text
If Len(v) = 8 Then
r.Clear
r.NumberFormat = "mm/dd/yyyy"
r.Value = DateSerial(Left(v, 4), Mid(v, 5, 2), Right(v, 2))
End If
Next r
End Sub
A quick method would be Data, Text-to-Columns, Fixed Width, Date: YMD, Finish. The following is for all intents and purposes in real-time.
Shouldn't take too much to record that into a sub procedure.
=DATEVALUE(TEXT(A1,"0000\/00\/00"))
and format the result as a date
I had the same problem. I used "Gary's Student's" answer. You have to press ALT+F11 and just copy and paste, then close that window. Then you select the cells you want to change, go to VIEW tab, on the far right is macros, hit view macros and select the one that says "INeedADate"