Changing A Column of Text Dates To True Numeric Dates

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,562
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a column of dates, that are text ("mmm dd, yyyy") not true numeric dates. I am seeking a VBA solution to change all these dates in the column (column 1) to true dates. I'm stumped.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
This seems to have worked.

VBA Code:
       With .Range("A2:A900")
            .NumberFormat = "yy-mmm-dd"     ' optional to set the display format
            .Value = .Value
        End With
 
Upvote 0
Give this a try... select the column with your dates, bring up the Text To Columns dialog box (Data tab, Data Tools panel), select Delimited, press Next, make sure the Space and Comma checkboxes are NOT checked and then click the Finish button.
 
Upvote 0
Thank you Rick, that worked as well! I assume that process can be done by VBA discoverable by macrto recorder.
 
Upvote 0
I would expect the Macro Recorder could do it, but the VBA is quite simple to construct. Assuming Column A...
VBA Code:
Sub MakeDates()
  Columns("A").TextToColumns , xlDelimited, , , , , False, False
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,273
Members
448,559
Latest member
MrPJ_Harper

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top