Results 1 to 2 of 2

Capture Keystroke - any way?

This is a discussion on Capture Keystroke - any way? within the Excel Questions forums, part of the Question Forums category; I have a textbox and I need to know if the user deletes the text or uses the backspace key ...

  1. #1
    Board Regular
    Join Date
    Apr 2008
    Posts
    61

    Default Capture Keystroke - any way?

    I have a textbox and I need to know if the user deletes the text or uses the backspace key to remove the text. Does anyone know of the code to check for the delete key or backspace key being used?

  2. #2

    Join Date
    Oct 2006
    Posts
    2,541

    Default Re: Capture Keystroke - any way?

    try
    Code:
    Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    If KeyCode = vbKeyBack Or KeyCode = vbKeyDelete Then

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com