Private Sub TextA_KeyPress(KeyAscii As Integer) If KeyAscii = vbKeyReturn Then If InStr(Me.TextA.Text, vbCrLf) <> 0 Then KeyAscii = 0 End If End If End Sub
Private Sub TextA_Change() Dim rPos As Long Dim lPos As Long lPos = InStr(Me.TextA.Text, vbCrLf) If lPos <> 0 Then rPos = InStrRev(Me.TextA.Text, vbCrLf) If lPos <> rPos Then Me.TextA.Text = Left$(Me.TextA.Text, rPos) & Mid$(Me.TextA.Text, rPos) Me.TextA.SelStart = Len(Me.TextA.Text) End If End If End sub