Sub CParse(): Dim S As String, i As Integer
Dim D1 As Date, T1 As Date, D2 As Date, T2 As Date
Dim C1 As String, S1 As String, D3 As Date, T3 As Date
Dim D4 As Date, T4 As Date, C2 As String, S2 As String
If ActiveCell = "" Then Exit Sub
S = ActiveCell
S2 = Right(S, 6): S2 = Left(S2, 2): S = Left(S, Len(S) - 6)
D1 = Left(S, 10): S = Right(S, Len(S) - 11)
If IsDate(Left(S, 8)) Then
If Mid(S, 3, 1) = ":" Then T1 = Left(S, 8)
Else
D2 = Left(S, 10): End If: S = Right(S, Len(S) - 11)
If D2 = 0 Then
D2 = Left(S, 10): S = Right(S, Len(S) - 11): End If
If IsDate(Left(S, 8)) Then
If Mid(S, 3, 1) = ":" Then
T2 = Left(S, 8)
S = Right(S, Len(S) - 11): End If: End If
i = InStr(1, S, "USA")
C1 = Left(S, i - 5): S1 = Mid(S, i - 3, 2)
S = Right(S, Len(S) - i - 3)
D3 = Left(S, 10): S = Right(S, Len(S) - 11)
If IsDate(Left(S, 8)) Then
If Mid(S, 3, 1) = ":" Then T3 = Left(S, 8)
Else
D4 = Left(S, 10): End If: S = Right(S, Len(S) - 11)
If D4 = 0 Then
D4 = Left(S, 10): S = Right(S, Len(S) - 11): End If
If IsDate(Left(S, 8)) Then
If Mid(S, 3, 1) = ":" Then
T4 = Left(S, 8)
S = Right(S, Len(S) - 11): End If: End If
C2 = S
ActiveCell.Offset(0, 1) = D1: ActiveCell.Offset(0, 2) = T1
ActiveCell.Offset(0, 3) = D2: ActiveCell.Offset(0, 4) = T2
ActiveCell.Offset(0, 5) = C1: ActiveCell.Offset(0, 6) = S1
ActiveCell.Offset(0, 7) = D3: ActiveCell.Offset(0, 8) = T3
ActiveCell.Offset(0, 9) = D4: ActiveCell.Offset(0, 10) = T4
ActiveCell.Offset(0, 11) = C2: ActiveCell.Offset(0, 12) = S2
ActiveCell.Offset(1, 0).Select
CParse
End Sub
And - You're welcome!
Bookmarks