View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Right click detection

The right-click normally brings up the cell context menu, so it is possible
to do one of two things
- add another menu item to invoke your macro
-disable the menu and invoke your code.

This is an example of the latter on a particular worksheet

Option Explicit

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
Cancel = True
MsgBox "hello"
End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"broogle" wrote in message
oups.com...
It possible to trigger the macro right after the user chose (right
click) copy ? thanks