Post your code and I can probably figure it out.
Printable View
Post your code and I can probably figure it out.
Drop three textboxes on your form and try the following.
Text1.text = "are"
Text2.text = 5
Text3.text = "How are you today? are you fine?"
Place this in a command button.
Text1 = the word or phase you are looking forCode:Dim int_Pos As Integer
Dim int_X As Integer
For int_X = 1 To CInt(Text2.Text)
int_Pos = int_Pos + 1
int_Pos = InStr(int_Pos, Text3.Text, Text1.Text)
If int_Pos = 0 Then Exit Sub
MsgBox Mid(Text3.Text, int_Pos + Len(Text1.Text), 50)
Next
Text2 = the cycle
Text3 = to your text files
Tell me if you need anything else.
Thanks
Works Great