ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Recognizing Ctl or shift key in VBA (https://www.excelbanter.com/excel-programming/418213-recognizing-ctl-shift-key-vba.html)

Rhythm

Recognizing Ctl or shift key in VBA
 
Does anyone know a way of recognizing whether the shift key or control key
are pressed from inside VBA. I want a userform button to behave differently
if one of these keys are pressed.

Bobt

Recognizing Ctl or shift key in VBA
 
Look up in help "KeyDown" and Keycode Constants. It's tricky to explain
here, but the help should be "helpful".

"Rhythm" wrote:

Does anyone know a way of recognizing whether the shift key or control key
are pressed from inside VBA. I want a userform button to behave differently
if one of these keys are pressed.


Jim Thomlinson

Recognizing Ctl or shift key in VBA
 
http://www.cpearson.com/excel/KeyTest.aspx
--
HTH...

Jim Thomlinson


"Rhythm" wrote:

Does anyone know a way of recognizing whether the shift key or control key
are pressed from inside VBA. I want a userform button to behave differently
if one of these keys are pressed.



All times are GMT +1. The time now is 05:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com