Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Dec 2000
    Location
    Sault Ste. Marie, Michigan, USA
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Detecting Shift-Click

    I have attached a number of buttons to macros in my personal.xls workbook. What property (if that's the right term) can I test from within the macro to see if the Shift key (or Control or Alt) was down when the button was clicked?

    Thanks,
    Ken

  2. #2
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Detecting Shift-Click

    Have a look at the thread
    <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showflat.pl?Cat=&Board=xl&Number=15761&page=&view= &sb=&vc=1>VBA Code to disable NumLock</A>

  3. #3
    2 Star Lounger
    Join Date
    Dec 2000
    Location
    Sault Ste. Marie, Michigan, USA
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Detecting Shift-Click

    Hans,

    Thanks for pointing me in the right direction. It took me a while to figure out that GetKeyState returns bit 8 on when a button is clicked with the shift key down, and bit 1 gets toggled by the key up event. Once I got that, the rest went well.

    Ken

Posting Permissions

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