Thanks jindon, it work perfectly.
for those who need this is the limit code I have also added
Dim temp As String
qtyset = ActiveSheet.Range("B8").Value
numlimit = qtyset - 1
'Enter is now a return key in this textbox1 filed
If KeyCode = vbKeyReturn Then
TextBox1.Text = Replace(TextBox1.Text, vbCrLf, "")
End If
'textbox QTY as limit coding
If TextBox1.CurLine > numlimit Then ' 0-based
'msgbox to display error
display = MsgBox("Input can't be more than " & qtyset & " lines.", vbCritical)
temp = TextBox1.Text
If Right$(temp, 2) = vbCrLf Then
temp = Left$(temp, Len(temp) - 2)
Else
temp = Left$(temp, Len(temp) - 1)
End If
TextBox1.Text = temp
End If
Bookmarks