View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mjclare[_5_] mjclare[_5_] is offline
external usenet poster
 
Posts: 1
Default Reading the ShiftKey state

Is it possible to read the ShiftState from within VBA?

My idea is to create a new menu item in the Data menu and have it ope
one of two possible dialog boxes. (Conceptually this is similar t
what happens when you hold down SHIFT while selecting Edit.) In m
case I wish to use the shift state to force it pop up a user form tha
can be used to modify settings that the user usually would not have an
need to access.

i.e.

Sub data_menu_new_1()

'
'
if ShiftState() Then
UserForm1.Show
else
UserForm2.Show
End If

End Sub

I've played around with KeyDown and KeyPress but it appears that thes
only fire when an actual keyboard (ANSI character) character flow
through the buffer.

Thanks,

Mik

--
Message posted from http://www.ExcelForum.com