This code works
Function ExtractNumber(target As Range) As Long
ExtractNumberString = target
Do While (Left(ExtractNumberString, 1) < "0") Or _
(Left(ExtractNumberString, 1) "9")
ExtractNumberString = Mid(ExtractNumberString, 2)
Loop
ExtractNumber = Val(ExtractNumberString)
End Function
"Curious" wrote:
This column is comment. Numbers mixed with text in the cells. They
look like
Statue of liberty 12345 statue of liberty
12345 statue of liberty statue of liberty
statue of liberty statue of liberty 12345
The number (product order code) could be anywhere.
How do I pull out the numbers by formula or by VB code?
Thanks in advance.
HZ