Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trapping the mouse
I would like to trap a key stroke before processing some code and then activating the stroke after. Can I do something similar to a mouse click? Thanks in advance for any clue, Sam K |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trapping the mouse
Hi Sam K,
If talk about mouse click on worksheets, unfortunately there are only two events for mouse: Double click and Right click. If you want to test them, try this: - Open your Workbook - Right click sheet tab - Click View Code command - Insert the code below: Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) MsgBox "You double click at " & Target.Address Cancel = True 'This avoid default behavior End Sub Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) MsgBox "You right click at " & Target.Address Cancel = True 'This avoid default behavior End Sub - Press Alt+F11 to back Excel window - Try double click and right click the sheet cells. HTH --- Orlando Magalhães Filho (So that you get best and rapid solution and all may benefit from the discussion, please reply within the newsgroup, not in email) "Sam K" escreveu na mensagem ... I would like to trap a key stroke before processing some code and then activating the stroke after. Can I do something similar to a mouse click? Thanks in advance for any clue, Sam K |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data trapping | Excel Worksheet Functions | |||
Error Trapping | Excel Discussion (Misc queries) | |||
Trapping #VALUE! error | Excel Discussion (Misc queries) | |||
Error Trapping from WSH | Excel Discussion (Misc queries) | |||
error trapping | Excel Discussion (Misc queries) |