This will disable it in all sheets. It goes in the workbook module.
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Cancel = True
End Sub
Juan Pablo G.
What about disabling only 1 sheet in the book
Hi Juan,
I only nee it to be disabled on 1 (a particular sheet)
any thoughts?
Jim
Re: What about disabling only 1 sheet in the book
Sure, paste this in the Sheet's module
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
End Sub
Or, in the same code that i sent put this.
If Sh.Name = "Sheet1" then Cancel = True
Juan Pablo G.
: This will disable it in all sheets. It goes in the workbook module. : Cancel = True : End Sub
Re: What about disabling only 1 sheet in the book
Jim,
Same event, different place.
Right click on the sheet tab for the sheet in question. Click on view code. This opens the code sheet "behind" the worksheet. In the left hand drop-down list box, select "Worksheet". Then in the right hand drop-down list box select the event you want to trap. Excel will put in the Sub and End Sub stuff all you need to do is put in Cancel = True as Juan advised.
enjoy
Hi Juan,
: This will disable it in all sheets. It goes in the workbook module. : Cancel = True : End Sub
Thanks guys, you were a big help
: I only nee it to be disabled on 1 (a particular sheet) : any thoughts? : Jim :