LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Trapping the Escape key when a dropdown validation list is display

Good afternoon,

I have some event code that when any cell in a certain range (which has
validation referring to a worksheet list), a SENDKEY Down is sent and the
screen display is zoomed up, to make reading of the drop down list easier.
Once the user makes a selection from the list, the display is zoomed back
down again.
However, if when the validation list is displayed, if the Escape key is
pressed, the display size remains the same. I have an ONKEY command, but it
only works if the ESCAPE key is pressed subsequently (i.e. you need to press
it twice).

Is there a way by which VBA can detect that the Escape key was pressed when
a validation list was displayed?

Here's the code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Zoom and simulate dropdown click when a cell in "ColWONo, ColA" is
selected

Application.OnKey "{ESC}", "Zoom120"
ActiveWindow.Zoom = 120

If Target.Cells.Count = 1 Then 'Check that the selected cell is a single
cell
If Not Intersect(Target, Range("ColWOActivityRole")) Is Nothing Then
ActiveWindow.Zoom = 150
Application.SendKeys ("%{DOWN}")
End If
End If
End Sub



Thanks in advance

Pete
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation dropdown list is not available Makelei Excel Discussion (Misc queries) 1 March 25th 10 08:06 PM
Validation Dropdown list starts at b ottom of list Tonso Excel Discussion (Misc queries) 2 March 17th 10 05:21 PM
Excell Dropdown List. Display alternate text than found in list. Shawnn Excel Discussion (Misc queries) 14 December 11th 08 07:43 PM
Trapping making a selection from a dropdown validation list Pete Rooney Excel Programming 2 March 20th 08 11:48 AM
Validation Dropdown List Smonczka Excel Programming 3 May 13th 05 12:47 AM


All times are GMT +1. The time now is 06:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"