Delete Rows in a protected worksheet

K

Kathy Connelly

I need to be able to delete rows in a protected worksheet.

When I protect the worksheet it gives me the option to be able to allow a
user to delete rows - I check that box. However, it will not allow me to
delete the rows after I protect it.

Can you tell me what I need to do?
 
M

Mike H

Hi,

The ability to delete rows on a protected sheet relies upon those rows being
unlocked.

Select the row(s) you want to be able to delete then
Format)Cells|Protection
remove the locked checkmark
Protect your sheet and you can still delete these rows.

Mike
 
G

Gord Dibben

Kathy

You can delete rows only if the entire row is unlocked before protecting the
sheet.

How will users select which rows to delete?

You could write code that would unprotect, insert rows at user's pre-defined
selection then re-protect the sheet.

Add a button for user to hit after selecting where to insert the rows.

Sub insertrows()
ActiveSheet.Unprotect Password:="justme"
Selection.EntireRow.Delete
ActiveSheet.Protect Password:="justme"
End Sub

Note: when protecting the sheet you must allow users to select locked cells.


Gord Dibben MS Excel MVP
 

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

Top