Sub ChangeDate()
Dim OrigTxtDate As String
Dim FormattedDate As String
Dim Month As String
Dim dte As Date
Dim Day As String
Dim Year As String
Dim myRange As Range
Dim NewDate As Date
On Error Resume Next
Dim s1 As Integer, s2 As Integer, s3 As Integer, s4 As Integer
Set myRange = Sheet1.Range("A1:A5") 'Set your range here.
For Each cell In myRange
OrigTxtDate = cell.Text
s1 = Application.WorksheetFunction.Search(" ", OrigTxtDate, 1) 'Locate first space
s2 = Application.WorksheetFunction.Search(" ", OrigTxtDate, s1 + 1) 'Locate second space
s3 = Application.WorksheetFunction.Search(" ", OrigTxtDate, s2 + 1) 'Locate third space
s4 = Application.WorksheetFunction.Search(",", OrigTxtDate, s1) 'Locate comma
Month = Mid(OrigTxtDate, s1 + 1, (s2 - s1) - 1)
Day = Mid(OrigTxtDate, s2 + 1, s4 - (s2 + 1))
Year = Right(OrigTxtDate, 4)
FormattedDate = convertMonthName2Number(Month) & "/" & Day & "/" & Year
NewDate = CDate(FormattedDate)
cell.Value = NewDate
Next
End Sub
Function convertMonthName2Number(monthName As String) As Integer
Dim dtestr As String
dtestr = monthName & "/1/2000"
Dim dte As Date
On Error Resume Next
dte = CDate(dtestr)
If Err.Number <> 0 Then
convertMonthName2Number = -999
Exit Function
End If
On Error GoTo 0
convertMonthName2Number = Month(dte)
End Function