Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default 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
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
Data trapping Flipper Excel Worksheet Functions 5 August 15th 08 09:04 PM
Error Trapping gazza67[_2_] Excel Discussion (Misc queries) 2 September 6th 07 06:11 PM
Trapping #VALUE! error RhysPieces Excel Discussion (Misc queries) 6 August 22nd 07 03:13 AM
Error Trapping from WSH Tom Chau Excel Discussion (Misc queries) 1 August 25th 06 04:21 AM
error trapping flow23 Excel Discussion (Misc queries) 3 April 13th 06 04:51 PM


All times are GMT +1. The time now is 11:48 AM.

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

About Us

"It's about Microsoft Excel"