Hi,
I want to know how to read certain lines from a textbox in a form.
What I need is the ability to read ONLY lines 5 - 10 of the textbox (I don't want the content of lines 1-4 or 11+).
Any info on this would be GREATLY appreciated - Thanks!
Hi,
I want to know how to read certain lines from a textbox in a form.
What I need is the ability to read ONLY lines 5 - 10 of the textbox (I don't want the content of lines 1-4 or 11+).
Any info on this would be GREATLY appreciated - Thanks!
This assumes your textbox has multiline set to TRUE
![]()
Dim vntLines As Variant Dim lngLine As Long Dim strText As String If Len(TextBox1.Text) > 0 Then vntLines = Split(TextBox1.Text, vbCrLf) strText = "" For lngLine = 4 To 10 If lngLine >= LBound(vntLines) And lngLine <= UBound(vntLines) Then strText = strText & vntLines(lngLine) & vbLf End If Next MsgBox strText, vbInformation, "Lines 5 to 11" End If
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks