I have the following script from another question that is helping me to split values in to a new column and convert text to dates
Dim StartString As String
Dim DateValue As String
Dim y As Integer
Dim LastRow2 As Long
With Sheets("DataSheet")
LastRow2 = .Cells(.Rows.Count, "L").End(xlUp).Row 'find the last row on column L
.Columns(13).Insert Shift:=xlToRight 'add a new column to the right of column L
For i = 1 To LastRow2 'loop through rows
If InStr(1, .Cells(i, "L"), ",") Then
.Cells(i, "M").Value = Split(.Cells(i, "L"), ",")(1) 'split after comma
StartString = .Cells(i, "L").Value
DateValue = ""
For y = 1 To Len(StartString) 'loop to remove unwanted characters
Select Case Asc(Mid(StartString, y, 1))
Case 47 To 57
DateValue = DateValue & Mid(StartString, y, 1)
End Select
Next y
.Cells(i, "M").Value = DateValue 'return the date
.Cells(i, "M").NumberFormat = "dd/mm/yyyy" 'format it correctly
End If
Next i
End With
The issue I have is that the conversion is not successful in all cases. This causes an issue in the next stage of my code as it uses the new dates as column headers that must be chronologically sorted. Any help is appreciated!
Below are also results (please ignore cells in yellow as this input error) The cells in green seem to have been converted successfully but you can see that many other the other cells have the small green error indicator in the top left corner. :

