EnterKey to press button in VBA Userform

后端 未结 6 1003
春和景丽
春和景丽 2020-12-31 04:45

I have a userform in Excel that asks for a username and password. Once you enter your password if you press Enter it just \"selects\" the next item which is the <

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-31 05:31

    Use the TextBox's Exit event handler:

    Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
        Logincode_Click  
    End Sub
    

提交回复
热议问题