Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Or, without using RegExp, this one-liner UDF...
Function FindLastNumber(S As String) As Variant FindLastNumber = Val(Mid(S, InStrRev(S, "-") + 1)) End Function -- Rick (MVP - Excel) "ryguy7272" wrote in message ... This is simple; somewhat crude: Function reNums(str As String) Dim re As Object Set re = CreateObject("vbscript.regexp") re.Global = True re.Pattern = "\D" reNums = re.Replace(str, "") End Function HTH, Ryan--- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "Benjamin" wrote: I need to strip just the numbers after the last - RV01-HYC0246-43-T-892A i.e. 892 RV01-HYC0246-43-H-892 i.e. 892 I know how to use the Right(and find("")) commands. Any help on just numeric character and not alphas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
separating numbers from a alphanumeric cell | Excel Worksheet Functions | |||
extract numbers from a alphanumeric cell | Excel Worksheet Functions | |||
Function to extract numbers from an alphanumeric cell | Excel Worksheet Functions | |||
separating numbers and letters from alphanumeric cell contents | Excel Worksheet Functions | |||
Sorting alphanumeric numbers | Excel Discussion (Misc queries) |