Hi I am trying to right a code that can read a set of strings that contains numbers and letters and I want to output only the numbers here is what i have
Function ExtractNumber(rCell As Range)
Dim iCount As Integer
Dim i As Integer
Dim sText As String
Dim lNum As Long
For iCount = Len(sText) To 1 Step -1
If IsNumeric(Mid(sText, iCount, 1)) Then
i = i + 1
lNum = CInt(Mid(sText, iCount, 1)) & lNum
If i = 1 Then lNum = CInt(Mid(lNum, 1, 1))
Next iCount
ExtractNumber = lNum
End Function
Function ExtractNumber(rCell As Range)
Dim iCount As Integer
Dim i As Integer
Dim sText As String
Dim lNum As Long
For iCount = Len(sText) To 1 Step -1
If IsNumeric(Mid(sText, iCount, 1)) Then
i = i + 1
lNum = CInt(Mid(sText, iCount, 1)) & lNum
If i = 1 Then lNum = CInt(Mid(lNum, 1, 1))
Next iCount
ExtractNumber = lNum
End Function