E
Eli
Hello Experts,
I'm using MS Access 2003 and I have a text box on a form that retrieves the
html of a dynamically changing web-page as a string.
I need to extract a number from that string
The number always (!) is a 5 digit number, 1 digit before a decimal point
and 4 digits after it.
The number has a changing # of characters before and after it, but 36
characters before it there (always!) is a unique word (no second recurrences
in the string): style="width:108px;"
Will this work:
Function getNumber(value As String) As String
Dim pos As Long
Const search = "style=""width:108px;"""
If Len(value) > 0 Then
pos = InStr(1, value, search, vbTextCompare)
If pos > -1 Then
'found
getNumber = Mid(value, pos + 36 + Len(search), 6) ' 1+point+4 =6
End If
End If
End Function
if it will, can you give me detailed instructions as of how to use it?
Thanks in advance
I'm using MS Access 2003 and I have a text box on a form that retrieves the
html of a dynamically changing web-page as a string.
I need to extract a number from that string
The number always (!) is a 5 digit number, 1 digit before a decimal point
and 4 digits after it.
The number has a changing # of characters before and after it, but 36
characters before it there (always!) is a unique word (no second recurrences
in the string): style="width:108px;"
Will this work:
Function getNumber(value As String) As String
Dim pos As Long
Const search = "style=""width:108px;"""
If Len(value) > 0 Then
pos = InStr(1, value, search, vbTextCompare)
If pos > -1 Then
'found
getNumber = Mid(value, pos + 36 + Len(search), 6) ' 1+point+4 =6
End If
End If
End Function
if it will, can you give me detailed instructions as of how to use it?
Thanks in advance