This code will take care of conditions 1-3.
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Dim newString As String
Rem restrict non-negative integer entry only
If Chr(KeyAscii) Like "[!0-9]" Then Beep: KeyAscii = 0
Rem impose maximum value
With TextBox1
newString = Left(.Text, .SelStart) & Chr(KeyAscii) & Mid(.Text, .SelStart + .SelLength + 1)
End With
If 1500 < Val(newString) Then
MsgBox "maximum value is 1500"
KeyAscii = 0
End If
End Sub
I don't understand condition 4. "One of the lines needs to be a matrix"
All user entries into a text box are strings, what strings might be entered as a matri