•1 min read•from Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community
Enabling or Hide "Delete" option on right click
Our take
In this discussion, a user seeks assistance in enabling or hiding the "Delete" option from the right-click menu for specific sheets in Excel. Despite attempting to implement VBA code, including commands for enabling and disabling the "Delete" control, the desired changes have not taken effect. The user notes that similar approaches worked in older Excel versions but are proving ineffective in the current version. This situation highlights the complexities of managing user interface options within Excel and the need for effective solutions.
Hello,
How I can enabled or hide "delete" option on few selected sheets.
So what I have tried is to put this to VBA on selected sheet workbook
Application.CommandBars("Ply").Controls("Delete").Enabled = True or even tried it with False
and nothing happen.
What I understood if tried using this on old excel version except "Ply" would be "Cell...", it wouldve work. But in current new one wont work.
I have asked chatgpt, looked up youtube tutorials and nothing help.
I have also tried this to thisWorkBook and still nothing happen. Can someone help me thx.
Private Sub Workbook_SheetActivate(ByVal Sh As Object) On Error Resume Next Select Case Sh.CodeName Case "Sheet27", "Sheet28", "Sheet29", "Sheet30", "Sheet32" Application.CommandBars("Ply").Controls("Delete").Enabled = False Application.CommandBars("Ply").Controls("Delete...").Enabled = False Case Else Application.CommandBars("Ply").Controls("Delete").Enabled = True Application.CommandBars("Ply").Controls("Delete...").Enabled = True End Select End Sub [link] [comments]
Read on the original site
Open the publisher's page for the full experience
Tagged with
#Excel compatibility#Excel alternatives for data analysis#Excel alternatives#rows.com#google sheets#financial modeling with spreadsheets#no-code spreadsheet solutions#delete#Excel#VBA#Enabled#Application.CommandBars#selected#sheets#Workbook_SheetActivate#CodeName#thisWorkBook#old excel version#controls#On Error Resume Next