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 Spreadsheets： Experience Efficiency Like Never Before with Kutools for Excel
Kutools for Excel boasts over 300 features, ensuring that what you need is just a click away...
Supports Office/Excel 2007-2021 & newer, including 365 | Available in 44 languages | Enjoy a full-featured 30-day free trial.
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!