niki
axes noob 'll b big 1 day
- Local time
- Today, 03:40
- Joined
- Apr 17, 2003
- Messages
- 66
hey!
Up to now this function helps me to find within a field the words situated after the word "Keywords:". This is, to talk in a visual manner, the left limit of my parsing area.
function:
Public Function TheKeyWords(longText As String) As String
Dim varPos As Variant
varPos = InStr(1, longText, "Keywords:")
If varPos > 0 Then
TheKeyWords = Mid$(longText, InStr(1, longText, "Keywords:") + 9)
Else
TheKeyWords = ""
End If
End Function
But being only a machine, my computer doesn't understand when the keywords stop. Due to an importing data problem, some words manage to get in the field keywords without being keywords.
This non interesting part of the field always starts with the sentence "Partners already aquired". How could I, sort of like my left limit earlier, have this sentence be my right limit, but this limit being not included in the field?
In other words, How could I tell my function, with an IF loop, that if it encounters "Partners already aquired" when searching through the field, it should stop and not give back this sentence as a result??
thx to anyone who can help
nico
Up to now this function helps me to find within a field the words situated after the word "Keywords:". This is, to talk in a visual manner, the left limit of my parsing area.
function:
Public Function TheKeyWords(longText As String) As String
Dim varPos As Variant
varPos = InStr(1, longText, "Keywords:")
If varPos > 0 Then
TheKeyWords = Mid$(longText, InStr(1, longText, "Keywords:") + 9)
Else
TheKeyWords = ""
End If
End Function
But being only a machine, my computer doesn't understand when the keywords stop. Due to an importing data problem, some words manage to get in the field keywords without being keywords.
This non interesting part of the field always starts with the sentence "Partners already aquired". How could I, sort of like my left limit earlier, have this sentence be my right limit, but this limit being not included in the field?
In other words, How could I tell my function, with an IF loop, that if it encounters "Partners already aquired" when searching through the field, it should stop and not give back this sentence as a result??
thx to anyone who can help
nico