Consulting

Results 1 to 6 of 6

Thread: Keyboard

  1. #1

    Keyboard

    Is there a way to disable using the arrow keys in vba? I want the user to be able to just click on a cell with the left mouse button, but nothing else.
    Thx

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    You could use the OnKey to assign them to the following sub.

    Sub Null()
    End Sub
    I'm curious why? Changing the arrows takes away a tool that some users use habitualy. Why make things harder for these users?

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Never tried it, but if you want to treat your users like children, this seems entirely appropriate.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  4. #4
    I am trying to create a game in excel, and I want to limit the users choice of where to click and what they can do.
    I was hoping that they was a function that would allow the user to just click once, but not use the arrow keys or type by mistake.

    I do agree that usually this is not the way to go ... but i dont see another option here.

  5. #5
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    The mouse is far from the cursor keys. Its very unlikely that a user would press one by mistake.
    If the user wants to play the game, they won't use the cursor keys if you ask them not to in the instructions. Game players don't need to have controls disabled, they want the game to run right.

  6. #6
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    For Excel games, have you tried Bartek's website. You might get assistance there
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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