Data in String

IanT

Registered User.
Local time
Today, 16:47
Joined
Nov 30, 2001
Messages
191
Hi
I have a field which contains a data string like:
SO - 119 - 3532 - £67.00 Amended New (oc:Mrs Sarah Haines)
or
SO - 125 - - £32.00 (oc:Mrs Lynn Carter)
What I need to do is identify the £67.00/£32.00 part of the strings. Can anyone help.
 
Something like this may work:

Code:
Public Function GetCurrency(ByVal strData As String) As Currency
    Dim intPos1 As Integer
    Dim intPos2 As Integer
    intPos1 = InStr(1, MyString, "£") + 1
    intPos2 = InStr(intPos1, MyString, " ") - 1
    GetCurrency = CCur(Mid(MyString, intPos1, intPos2 - intPos1))
End Function
 
You're very good with string handling, SJ :)
 

Users who are viewing this thread

Back
Top Bottom