Reputation: 1
How do I extract an email address from a string?
xxx [email protected] yyy
xxx and yyy can be any length, any character. The email address is delimited by spaces.
Upvotes: 0
Views: 412
Reputation: 91366
One possibility:
sString = "[email protected] xxx [email protected] yyy [email protected]"
asString = Split(sString, " ")
For i = 0 To UBound(asString)
If asString(i) Like "*@*.*" Then
sEmail = sEmail & "," & asString(i)
End If
Next
MsgBox Mid(sEmail, 2)
Upvotes: 2