How to disable right click on sheet tab in Excel?
This article is talking about disabling right-click on sheet tab in a workbook. Please do as below method step by step.
Excel Productivity Tools
Office Tab: Bring powerful tabs to Office (include Excel), just like Chrome, Safari, Firefox and Internet Explorer. Save you half the time, and reduce thousands of mouse clicks for you. 30-day Unlimited Free Trial
Kutools for Excel: Save 70% of your time and solve 80% Excel problems for you. 300+ advanced features designed for 1500+ work scenario, make Excel much easy and increase productivity immediately.60-day Unlimited Free Trial
The following VBA script can help you to disable the right-click menu on sheet tab in Excel. Please do as follows.
1. In the workbook you need to disable the right-click function on sheet tab, press the Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window.
2. In the Microsoft Visual Basic for Applications window, double click ThisWorkbook on the left Project pane, then copy and paste the following VBA code into the ThisWorkbook (Code) window. See screenshot:
VBA code: Disable right click on sheet tab in Excel
Private Sub Workbook_BeforeClose(Cancel As Boolean) Application.CommandBars("Ply").Enabled = True End Sub Private Sub Workbook_Open() Application.CommandBars("Ply").Enabled = False End Sub
3. Then press the Alt + Q keys simultaneously to close the Microsoft Visual Basic for Applications window.
4. Click File > Save As. In the Save As dialog box, please specify a folder where you need to save the workbook, name it in the File name box as you need, and select Excel Macro-Enabled Workbook option from the Save as Type drop-down list, and finally click the Save button.
Now the workbook has been saved as an Excel macro-enabled workbook, and the right click function on sheet tab is disabled while using this workbook.
- How to disable cut, copy and paste functions in Excel?
- How to disable the right click menu in specified worksheet or whole workbook in Excel?
- How to prevent or disable edit mode by double clicking cell in Excel?
Excel Productivity Tools
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
To post as a guest, your comment is unpublished.
To post as a guest, your comment is unpublished.· 4 months agoSuperb Right Click in sheet tab is working.
To post as a guest, your comment is unpublished.· 1 years agoPrivate Sub Workbook_Open()
Application.CommandBars("Ply").Enabled = False
this only deactivates RIGHT CLICK -- does not prevent the DOUBLE CLICK on tab from being renamed...