+ Reply to Thread
Results 1 to 4 of 4

Prompt for KeyStrokes

  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    Tolland, CT
    MS-Off Ver
    Excel 2007
    Posts
    37

    Prompt for KeyStrokes

    Hi all,

    I'm looking for a way to prompt the user for keystrokes in order to choose the direction they would like to move values in a cell. Currently I have a Prompt box and the user needs to type the words "Up" "Down" "Left" or "Right." If possible I would like to have the program hold and wait for the user to press one of the keyboard directional buttons in order for the program to decide which direction they choose.

    If anyone knows an easy way to make that happen I would be greatful.

    Thanks

    Edit:
    I have been looking at the KeyDown event, but i am very confused by it. It seems like a certain window or user form needs to be active in order for it to detect keystrokes. Is there a way to create a textbox that i can just tuck away and have it open at all time looking for keystrokes? and if so does the program just wait for input if i call the KeyDown event?
    publius
    Last edited by publius190; 01-17-2014 at 05:09 PM.

  2. #2
    Forum Contributor
    Join Date
    01-14-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    240

    Re: Prompt for KeyStrokes

    Have a play with the GetKeyState windows API function.


    Please Login or Register  to view this content.

  3. #3
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Prompt for KeyStrokes

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-21-2012
    Location
    Tolland, CT
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Prompt for KeyStrokes

    Both fantastic explanations. Thanks guys

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Retrieve keystrokes to VBA
    By neta in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-13-2009, 02:58 AM
  2. Trap Keystrokes
    By Steel Monkey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2007, 08:13 PM
  3. Count keystrokes
    By PennStan in forum Excel General
    Replies: 2
    Last Post: 05-28-2006, 11:35 AM
  4. [SOLVED] VBA to disable keystrokes?
    By Mark in forum Excel General
    Replies: 3
    Last Post: 05-24-2006, 10:55 AM
  5. [SOLVED] Mimic keystrokes?
    By Targus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2006, 01:15 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1