Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing Letters from ProductCode - Leaving Number

Status
Not open for further replies.
May 21, 2003
64
US
I have product codes I'm trying to match. One company lists thiers as kfrt8950, another lists the same product as d8950pk. They are not consistant, so a "left" and "right" would not work. I would like to remove all letters so I can match on the actual numbers. Let me know if you have any ideas.
 
Something like this ?
Public Function getDigits(strProduct)
Dim i As Integer, s As String, x As String
If IsNull(strProduct) Then Exit Function
s = ""
For i = 1 To Len(strProduct)
x = Mid(strProduct, i, 1)
If x >= "0" And x <= "9" Then
s = s & x
End If
Next i
getDigits = s
End Function

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top