Function KeepNumericAndDot(str As String) As String With CreateObject("VBScript.RegExp") .Global = True .Pattern = "[^0-9\.\-]+" KeepNumericAndDot = .Replace(str, "") End With End Function