Delete contents of unprotected cells in workbook

B

BD7447

Hi,

I have a workbook with half a dozen protected pages. Within each page is a
range of unprotected cells.

What I'm trying to do is write a macro which will delete the contents of all
unprotected cells in the workbook. I've attempted writing this by selecting
each of the unprotected cells in each page, then deleting.

However, when I then assign the macro and run this, I get a runtime error
because I am attempting to delete content from a protected sheet.

Is there a simple way of doing what I want? Indeed, is there any way to do
what I want, without unprotecting the workbook? Or, should I incorporate
unprotecting and then reprotecting each sheet into the macro? I'd rather avoid
this if I can?

Many thanks
 
D

Don Guillett

try doing it sheet by sheet to delete but with a onerror resume next to
bypass the protected.
 

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