Result in Col.B to the right.
Sub test()
Dim r As Range, x
For Each r In Range("a1", Range("a" & Rows.Count).End(xlUp))
If InStr(1, r.Value, "The symbols are", 1) Then
x = GetSymbols(r.Value, ";", ":", ".")
If UBound(x) > -1 Then r(, 2).Resize(, UBound(x) + 1).Value = x
End If
Next
End Sub
Function GetSymbols(ByVal txt As String, ParamArray myStr())
Dim x, e, i As Long
For Each e In myStr
txt = Replace(txt, e, ",")
Next
x = Application.Trim(Split(txt, ","))
For i = 1 To UBound(x)
If (Not x(i) Like UCase$(x(i))) + (Len(x(i)) < 3) + (Len(x(i)) > 4) Then x(i) = Chr(2)
Next
GetSymbols = Filter(x, Chr(2), 0)
End Function
Bookmarks