Disabling Right Click Menu

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

Can anyone tell me the code to disable the right click
menu on a worksheet?
 
Tom said:
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 *
 
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
 

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