Here is my problem:
On a worksheet I set up I put a CommandButton on the top. Once that gets clicked it fires up a UserForm that enables the user to drill down into the displayed data in 7 different ways till Sunday
95% of the time it is the same type of drill down that the user wants. So what I want to program is that if the user holds down SHIFT and then clicks the CommandButton, the above mentioned UserForm isn't even coming up - the "standard" drill down gets performed immediately.
Therefore what I would like to do in the Sub CommandButton_Click is to check if the user was pressing the shift button when he clicked on the CommandButton (i.e. what is the status of the Modifier keys?). I know it should be a fairly simple call of some MS Windows Systems routine that just returns the status of the the ModifierKeys (Shift, Ctrl, Alt, etc). I have spend about an hour searching for the name of the right routine on the MS developers website, but can't seem to find the solution I need.
I am using MS Windows XP Pro and MSExcel 2003.
The help I need:
Any help would be highly appreciated!
Thanks,
J.W.
On a worksheet I set up I put a CommandButton on the top. Once that gets clicked it fires up a UserForm that enables the user to drill down into the displayed data in 7 different ways till Sunday
95% of the time it is the same type of drill down that the user wants. So what I want to program is that if the user holds down SHIFT and then clicks the CommandButton, the above mentioned UserForm isn't even coming up - the "standard" drill down gets performed immediately.
Therefore what I would like to do in the Sub CommandButton_Click is to check if the user was pressing the shift button when he clicked on the CommandButton (i.e. what is the status of the Modifier keys?). I know it should be a fairly simple call of some MS Windows Systems routine that just returns the status of the the ModifierKeys (Shift, Ctrl, Alt, etc). I have spend about an hour searching for the name of the right routine on the MS developers website, but can't seem to find the solution I need.
I am using MS Windows XP Pro and MSExcel 2003.
The help I need:
- What is the name of the routine I need to call?
- What is the exact Declare Statement I need to use in order to be able to call this routine?
- Outside that Declare Statement, do I need to Define any variables (I always turn Option Explicit on)
Any help would be highly appreciated!
Thanks,
J.W.