Excel check len string separated by comma [closed]

@David Zemens idea.. this should work .Tested

Sub test()
Dim str As String
Dim s() As String


str = "15f,158,1669,187,15,156,47t"
s = Split(str, ",")


For i = LBound(s) To UBound(s)

If Len(s(i)) = 3 Then

t = IIf(t = "", s(i), t & "," & s(i))

End If

Next i

MsgBox (t)

End Sub

Leave a Comment