ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disabling Right Click Menu (https://www.excelbanter.com/excel-programming/307294-disabling-right-click-menu.html)

Tom

Disabling Right Click Menu
 
Can anyone tell me the code to disable the right click
menu on a worksheet?

Rob Bovey

Disabling Right Click Menu
 
"Tom" wrote in message
...
Can anyone tell me the code to disable the right click
menu on a worksheet?


Hi Tom,

Put this procedure in the code module located behind the workhseet whose
shortcut menu you want to disable:

Private Sub Worksheet_BeforeRightClick( _
ByVal Target As Range, Cancel As Boolean)
Cancel = True
End Sub

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *




Greg Wilson[_4_]

Disabling Right Click Menu
 
This will toggle the enabled status of the right-click
menu:

Sub TogRightClick()
With Application.CommandBars("Cell")
..Enabled = Not .Enabled
End With
End Sub

Regards,
Greg

-----Original Message-----
Can anyone tell me the code to disable the right click
menu on a worksheet?
.



All times are GMT +1. The time now is 01:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com