Sorry, I forgot to tell you how to do it. Here's one way:
ActiveSheet.Unprotect Password:="Pete_1"
your existing code ...
ActiveSheet.Protect Password:="Pete_1"
Hope this helps.
Pete
Thanks for the suggestion Pete. However, I'm wondering if the cells can be
locked and hidden before the macro is run, or am I out of luck?
> Sorry, I forgot to tell you how to do it. Here's one way:
>
[quoted text clipped - 26 lines]
> >
> > - Show quoted text -
Gord Dibben - 23 May 2008 23:53 GMT
You want a macro to hide and lock cells on a protected sheet but you want those
cells hidden and locked before the macro runs to hide and lock those cells.
Have I got it right?
If so, why?
Just run the macro on an unprotected sheet then at the end of the macro, protect
the sheet.
Gord Dibben MS Excel MVP
>Thanks for the suggestion Pete. However, I'm wondering if the cells can be
>locked and hidden before the macro is run, or am I out of luck?
[quoted text clipped - 29 lines]
>> >
>> > - Show quoted text -