Hi VectorZ,
You could try something like this. (modify to suit)
Sub ParseMyString3()
Dim s1 As String, s2 As String, s3 As String, s4 As String
Dim iPos As Integer
Dim lLastRow As Long, r As Long
s1 = "A##-#S"
s2 = "A#-#S"
s3 = "ARG###"
s4 = "FO"
With Range("A:A")
lLastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
For r = 1 To lLastRow
If .Cells(r, 1) <> "" Then
iPos = 0
If .Cells(r).Value Like "*" & s1 Then
.Cells(r, 2).Value = Right$(.Cells(r, 1).Value, 5)
ElseIf .Cells(r).Value Like "*" & s2 Then
.Cells(r, 2).Value = Right$(.Cells(r, 1).Value, 4)
ElseIf .Cells(r).Value Like "*" & s3 Then
.Cells(r, 2).Value = Right$(.Cells(r, 1).Value, 5)
ElseIf .Cells(r).Value Like "*" & s4 Then
.Cells(r, 2).Value = Right$(.Cells(r, 1).Value, 2)
End If
End If
Next r
End With
End Sub
HTH
Regards,
Garry
Bookmarks