protecting cells with macros

M

maly_pajak

does anyone know how to protect (unprotected) cells with macros whil
the sheet itself is protected? i'm running into run-time error
(Unable to set the Locked propertyof the Range class '1004').

thanks!

maly_paja
 
J

Joe Bloggs

Maly

I'm not sure what you want but normally the cells to be
operated on are first unlocked on the Format Menu before
the sheet is protected.

If you need to unprotect the sheet during a macro you can
use a toggle in the code.

Protect = not proctect

Record the Protecting and Unprotecting the macro then
revise the code

regards
Peter Atherton
(e-mail address removed)
 
J

JON JON

Hello Maly,

You need to unprotect your sheet first.

Activesheet.Unprotect "PASSWORD"
'your code here
Activesheet.Protect "PASSWORD"

Replace "PASSWORD" with your password if there is any otherwise don't
include that word.

Regards,

Jon-jon
 

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