Right Click Event

danbates

Active Member
Joined
Oct 8, 2017
Messages
377
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I've just added a right click event to call a macro which works fine but it also it is bringing up the normal cut and paste menu.

How can I disable just the cut and paste menu?

Thanks

Dan
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Where is this right click event.
Is this in a userform activex control sheet or what?
 
Upvote 0
It's just on a normal sheet and on any cell but it's restricted to a certain row each time via the cells being locked and protected. Here is my code:
Code:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Call BlankOutDRS
End Sub
 
Upvote 0
OK. I see what you mean.
I have no answer.
Why not use a double click event?
Double click the cell and it does something.
 
Upvote 0
Example:
Code:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column = 3 Then
Cancel = True
Call BlankOutDRS
End If
End Sub
 
Upvote 0
Hi,

That's sorted it. Thank you again :)

I didn't want to use the double click event because I'm already using that for something else and I am trying to make the sheet as user friendly as possible.

Thank again for your help.

Kind Regards
Dan
 
Upvote 0
Not sure if you mean you found a answer to the right click problem or just decided to use double click.
If you find a answer to the right click problem let us know.
Glad I was able to help you. Come back here to Mr. Excel next time you need additional assistance.

Hi,

That's sorted it. Thank you again :)

I didn't want to use the double click event because I'm already using that for something else and I am trying to make the sheet as user friendly as possible.

Thank again for your help.

Kind Regards
Dan
 
Upvote 0
To cancel the default menu, you use the same technique as with the DoubleClick event, namely adding:
Code:
Cancel = True
to the code.
 
Upvote 0
That is nice to know.

I use that on double click but to be honest I really do not know what that means but it works.
To cancel the default menu, you use the same technique as with the DoubleClick event, namely adding:
Code:
Cancel = True
to the code.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top