Or
Code:
Function ExtractPhoneNum(s As String) As String
Do Until InStr(s, "-") = 0 And InStr(s, ")") = 0 And InStr(s, "(") = 0 And InStr(s, "+") = 0
s = Replace(s, "-", " ")
s = Replace(s, ")", "")
s = Replace(s, "(", "")
s = Replace(s, "+", "")
Loop
If InStr(s, "x") > 0 Then s = Left(s, InStr(s, "x") - 1)
ExtractPhoneNum = s
End Function
Might be easier to add to that vs more nested Replace functions. That also eliminates using val.
EDIT - As is so often the case, desired output not shown as far as I can see.