UNKNOWN '************************************** ' Name: Get longest number in a string ' Description:This code extract the long ' est number in a string Example if you have: "asdfu2243jfoaij9oija88ioaj" it will return 2243 ' By: Francisco M ' ' ' Inputs:None ' ' Returns:None ' 'Assumes:None ' 'Side Effects:None 'This code is copyrighted and has limite ' d warranties. 'Please see http://www.Planet-Source-Cod ' e.com/xq/ASP/txtCodeId.74483/lngWId.1/qx ' /vb/scripts/ShowCode.htm 'for details. '************************************** Private Function trimStrNum2(ByVal strVal As String) As String Dim i As Integer Dim strTmp() As String Dim chrTmp As String On Error Resume Next For i = 1 To Len(strVal) chrTmp = Mid(strVal, i, 1) If Not IsNumeric(chrTmp) Then strVal = Replace(strVal, chrTmp, " ") End If Next strTmp = Split(strVal, " ") For i = 0 To UBound(strTmp) - 1 If Len(trimStrNum2) < Len(strTmp(i + 1)) Then trimStrNum2 = strTmp(i + 1) End If Next End Function