Hi,

I'm hoping someone here can help.

I have an Excel Spreadsheet with a UserForm. When data is entered in the textbox, a commandbutton is enabled that will allow me to go onto the next form. However, if I enter a line of text, hit enter, then enter another line of text, the form freezes. I can hit control-break to step through the code, after stepping through the code twice, the button will then become enabled.

The data is transferring to the spreadsheet without an issue.

I have MultiLine and EnterKeyBehavior both set to 'True'.

I'm using Excel 2007.

The problem only occurs when there are mutliple lines of text.

Here is my code:
Private Sub txtComments_Change()
If Me.cmbcategory <> "" Then Me.cmdnextform.Enabled = True

c1text= txtComments.Value
    If InStr(c1text, Chr(13)) <> 0 Then
        c1text = Replace(c1text, Chr(13), " ")
    End If
        
If c1text= "" Then Me.cmdnextform.Enabled = False

If Me.cmbYesNo.Value = "No" Then Me.cmdnextform.Enabled = True

End Sub
Thank you