Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Fri, 2 Oct 2009 02:54:01 -0700, Faraz A. Qureshi
wrote: Any UDF code to have entries like following: 1234Text 12Text34 Text1234 be converted to: 1234 1234 1234 Thanx in advance! ===================== Function Nums(s As String)as String Dim re As Object Set re = CreateObject("vbscript.regexp") re.Global = True re.Pattern = "\D+" Nums = re.Replace(s, "") End Function ======================== Note that by returning the result as String, leading zero's can be retained. If this is not wanted or desireable, then return result as Long or as Double. --ron |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
TO DELETE ONLY NUMERIC VALUES IN A CHARACTER AND NUMERIC CELL IN | Excel Discussion (Misc queries) | |||
Return Numeric Labels that have different Numeric Values | Excel Worksheet Functions | |||
extracting just numeric value out from alphaneumeric cell | Excel Discussion (Misc queries) | |||
Extracting Numeric Data from a Delimited Text String | Excel Worksheet Functions | |||
Extracting numeric values from string | Excel Worksheet Functions |