Validation message of text box entry on modeless form interrupts text selection
Hi I try this code in my Userform to check if Data entered in textbox1 is a number and if is not show a msgbox to user and select text in textbox1 , but below code doesn't select text in textbox1 when Userform is vBModeless Private Sub TextBox1_Change() If Not IsNumeric(TextBox1) Then MsgBox " only number" TextBox1.SetFocus TextBox1.SelStart = 0 TextBox1.SelLength = Len(TextBox1.Text) End If End Sub is any solution? In my version of Excel A msgbox is always vbModal, it cannot be vbModeless, you can only set its Modal scope property to be as application level or system level At Application