Deactivating Insert/Delete Row/Column

  • Thread starter Thread starter marston.gould
  • Start date Start date
M

marston.gould

I have a specialized worksheet that will require that I create a new
menu function that tightly controls how rows are added and deleted and
does not allow for insertion or deletion of columns on a worksheet.

I think I know how to create the custom menu, but how do I deactivate
the insert or deletion of rows/columns using the standard method.
 
In the workbook_open event eliminate the or gray out the option to do what
you want. Here's some code that disables the delete option from the menu:

'Stop user from being able to delete
Application.CommandBars("Column").Controls("&Delete").Enabled = False
Application.CommandBars("Row").Controls("&Delete").Enabled = False
Application.CommandBars("Column").Controls("&Delete...").Enabled = False
Application.CommandBars("Row").Controls("&Delete...").Enabled = False
Application.CommandBars("Edit").Controls("Delete...").Enabled = False
Application.CommandBars("Cell").Controls("Delete...").Enabled = False

Don't forget to re-enable these options on the workbook close or the next
time the user uses excel he won't have these options.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top