You can use
Mid$(...)
to extract the number
if the formatting is fixed.
Use the
InStr(...)
and
InstrRev(...)
functions to find the positions of the numeric part of the string if you have specific strings that delimit the number in the string, and
then use
Mid$()
.
Tell us what the general format of the possible strings is (with widths where known) and we can try to help further.
Sorry about you being stuck in VB6.
My wife has the same problem at her job.
(Tiny company. Legacy code. No budget for rewrite.)
EDIT: revised in response to comments:
So,
if the beginning of the string is
always exactly "AV,BC,"
then it looks like extracting the number could be done with:
Dim sText as String
Dim vNumber As Double
sText = "AV,BC, 0.12345kg"
vNumber = Val(Mid$(sText, 7))
This assumes you want the value of the number, not just the string.
If you really want just the text of number part of the string, then:
Dim sText as String
Dim sNumber As String
sText = "AV,BC, 0.12345kg"
sNumber = Val(Mid$(sText, 7, Len(sText) - 9))