Hi, I currently have the code below that will insert rows into a protected sheet base on the row/rows selected by the user. I added a command to the Context Menu to run this macro when the user right clicks on a row number. It works very well except when the user selects multiple nonconsecutive rows, I get a " Run-time error '1004': Insert method of Range class Failed". I believe this is due to the fact that excel does not let you insert multiple rows when within a Table. Although I would love for the user to be able to add these rows as selected, the biggest problem I have with this is that the sheet is left unprotected after the error is received.
Is there any way to modify this code to allow the user to insert multiple non-consecutive rows when a table is used? If not, how would I modify the code to either give the user a megbox stating that they cannot add the rows as selected, or at a minimum how would I add code to protect the sheet prior to erroring out?
This thread is cross-posted at https://www.mrexcel.com/board/thread...table.1157620/
Thanks,
Bookmarks