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.
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?
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!