VBA Code to stop insert and delete

Malcolm torishi

Board Regular
Joined
Apr 26, 2013
Messages
219
Hi
can any one help please. Is there a way of stopping a user to insert or delete rows and columns by not protecting the sheets and keeping All other icons and functions still available on all ribbons
thank you
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
On the sheet you want to protect, you should go to the review tab on the ribbon and click "Protect Sheet".

In my version (I'm not really familiar with others), there is a list of checkboxes including:

"Format Columns"
"Format Rows"
"Insert Columns"
"Insert Rows"
"Delete Columns"
"Delete Rows"

If you check those boxes but leave the others blank, that should accomplish what you're looking for.

Edit: This is the Normal Way to accomplish this, but the same thing can be done via VBA if you need that
 
Last edited:
Upvote 0
Hi thank you for coming back. One question will this still allow a user to have all icons and functions available on all ribbons
 
Upvote 0
Yes, If you use the insert and delete options, then everything outside of Inserting/Deleting should function normally.

Though an important note:

I said this before
If you check those boxes but leave the others blank, that should accomplish what you're looking for.

But Really, its the other way around. You want to check all the boxes EXCEPT the rows/columns options.
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top