Right click detection

  • Thread starter Thread starter broogle
  • Start date Start date
B

broogle

It possible to trigger the macro right after the user chose (right
click) copy ? thanks
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top