Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7730465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:13:51+00:00 2026-06-01T06:13:51+00:00

I am creating an Excel add-in written in VB.NET. I would like to bind

  • 0

I am creating an Excel add-in written in VB.NET. I would like to bind KeyDown and KeyUp events to the spreadsheet to record when the user presses and releases the arrow keys while navigating the spreadsheet.

Ideally, these events would be built into Excel alongside the native SheetActivate and SheetSelectionChange events, for example. Alas, they are not.

Please note that I am NOT interested in the KeyDown/KeyUp events for Windows form controls, as I am not using a Windows form for this. Rather, I want to create these events at the Excel application, workbook, or worksheet level.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:13:53+00:00Added an answer on June 1, 2026 at 6:13 am

    You could use the Windows API call GetAsyncKeyState in conjunction with the SelectionChange event

    Here’s a small VBA snippet to demonstrate

    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        Dim Key As Long
        For Key = 3 To 255
            If GetAsyncKeyState(Key) Then
                MsgBox "KeyCode: " & Key & " was pressed."
            End If
        Next
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an excel add-in in c#. In the add-in the user creates
I am creating an excel report in vb.net using the office interop. When the
I am creating a small rails app for personal use and would like to
Using c# MS Excel interop library, I would like to programmatically create a new
is there a (.net-)library for creating PowerPoint-Presentations (PPTX => OpenXML). For creating Excel-sheets I
Possible Duplicate: python: creating excel workbook and dumping csv files as worksheets How would
I'm creating an excel add-in and i wanted to use up/down characters in a
I am creating a macro to add data from my Excel sheet into my
I'm totally stuck on creating a user defined function in Excel VBA for the
I'm creating buttons dynamically on an Excel userform with the following code: With Me.CurrentFrame.Controls.Add(Forms.CommandButton.1)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.