Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is my offering...
Function ExtractNumber(rCell As Range) As Double Dim X As Long For X = 1 To Len(rCell.Value) If Mid$(rCell.Value, X, 1) Like "*[0-9.]" Then ExtractNumber = Val(Mid$(rCell.Value, X)) Exit For End If Next End Function Rick "caroline" wrote in message ... hello, I am using the following code to extract numbers from a string http://www.ozgrid.com/VBA/ExtractNum.htm however when I have strings like WS123ABC45cft, I would like to extract only the first set of number"123". The code provided extracts "12345" Do you know how to correct the code? Please note that the number of numbers and letters are variables so I cannot use LEFT or RIGHT. thanks -- caroline |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Extract numbers from a string of text | Excel Discussion (Misc queries) | |||
extract numbers from a string | Excel Worksheet Functions | |||
Only extract numbers from a string of text | Excel Discussion (Misc queries) | |||
Extract Numbers From String | Excel Programming | |||
Extract numbers from a string ? | Excel Programming |