• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Trigger KeyDown Or KeyUp

delta

Member
i try to TextBox6 KeyDown Or KeyUp is Trigger then
commandbutton1 click (execute macro in commandbutton1)


>>> as many times <<<
>>> use code - tags <<<
Code:
Private Sub TextBox6_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Select Case KeyAscii
        Case 13 'enter key
          commandbutton1_Click
      
        Case Else
    End Select
end sub
or
Code:
Private Sub TextBox6_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyUp = vbKeyReturn Then
    CommandButton1_Click
    'KeyCode = 0
End If
End Sub
but not working pls help for correct code
 
Last edited by a moderator:
Back
Top