View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Township of East Hanover Township of East Hanover is offline
external usenet poster
 
Posts: 31
Default Deactivating Insert/Delete Row/Column

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("&Delet e").Enabled = False
Application.CommandBars("Row").Controls("&Delete") .Enabled = False
Application.CommandBars("Column").Controls("&Delet e...").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.


" wrote in message
oups.com...
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.