How to Replace a string on first line of a text box.
Posted on January 4, 2009
1 2 3 4 5 6 7 | 'String Manipulation - How to Replace a string on first line of a text box. Private Sub Command1_Click() Dim lPos As Long lPos = InStr(Text1.Text, vbCrLf) If lPos = 0 Then lPos = Len(Text1.Text) + 1 Text1.Text = Replace(Left$(Text1.Text, lPos - 1), "a", "b") & Mid$(Text1.Text, lPos) End Sub |