10-29-2009, 07:26 AM
I have been using following function to find a value between two words. It returns correct value when I have no duplicate words but in the opposite case this function returns me incorrect value.
Please see the attachment for more details. Any help would be really appreciated
Thanks in advance
Code:
Function ParseScreenVal(varString,varCurr,varNext)
i = varString
i = CStr(i)
varCount = instr( 1,i,varCurr,vbTextCompare)
varCount2 = instr( 1,i,varNext,vbTextCompare)
ParseScreenVal = Mid(i, varCount + len(varCurr),varCount2-varCount - len(varCurr))
End Function
Please see the attachment for more details. Any help would be really appreciated
Thanks in advance