Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Hide and lock cell formulas without affecting Macro?

Is there any way to hide and lock cells on a worksheet without affecting a
Macro? I have written a Macro that hides rows on a worksheet that have zero
value, I run the Macro through a form button. However, when I protect the
worksheet so the hide/lock feature takes effect, it takes away my ability to
run the Macro. Any ideas how to run my Macro but still be able to hide and
lock my cells containing certain formulas?

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Hide and lock cell formulas without affecting Macro?

Your macro could unprotect the sheet, do its stuff, and then protect
the sheet again at the end. You will need to provide your password (if
used) within the macro.

Hope this helps.

Pete

On May 22, 12:26*am, Mike wrote:
Is there any way to hide and lock cells on a worksheet without affecting a
Macro? I have written a Macro that hides rows on a worksheet that have zero
value, I run the Macro through a form button. However, when I protect the
worksheet so the hide/lock feature takes effect, it takes away my ability to
run the Macro. Any ideas how to run my Macro but still be able to hide and
lock my cells containing certain formulas?

Thanks in advance.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Hide and lock cell formulas without affecting Macro?

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

On May 22, 12:35*am, Pete_UK wrote:
Your macro could unprotect the sheet, do its stuff, and then protect
the sheet again at the end. You will need to provide your password (if
used) within the macro.

Hope this helps.

Pete

On May 22, 12:26*am, Mike wrote:



Is there any way to hide and lock cells on a worksheet without affecting a
Macro? I have written a Macro that hides rows on a worksheet that have zero
value, I run the Macro through a form button. However, when I protect the
worksheet so the hide/lock feature takes effect, it takes away my ability to
run the Macro. Any ideas how to run my Macro but still be able to hide and
lock my cells containing certain formulas?


Thanks in advance.- Hide quoted text -


- Show quoted text -


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Hide and lock cell formulas without affecting Macro?

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?

"Pete_UK" wrote:

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

On May 22, 12:35 am, Pete_UK wrote:
Your macro could unprotect the sheet, do its stuff, and then protect
the sheet again at the end. You will need to provide your password (if
used) within the macro.

Hope this helps.

Pete

On May 22, 12:26 am, Mike wrote:



Is there any way to hide and lock cells on a worksheet without affecting a
Macro? I have written a Macro that hides rows on a worksheet that have zero
value, I run the Macro through a form button. However, when I protect the
worksheet so the hide/lock feature takes effect, it takes away my ability to
run the Macro. Any ideas how to run my Macro but still be able to hide and
lock my cells containing certain formulas?


Thanks in advance.- Hide quoted text -


- Show quoted text -



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Hide and lock cell formulas without affecting Macro?

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


On Fri, 23 May 2008 12:37:00 -0700, Mike wrote:

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?

"Pete_UK" wrote:

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

On May 22, 12:35 am, Pete_UK wrote:
Your macro could unprotect the sheet, do its stuff, and then protect
the sheet again at the end. You will need to provide your password (if
used) within the macro.

Hope this helps.

Pete

On May 22, 12:26 am, Mike wrote:



Is there any way to hide and lock cells on a worksheet without affecting a
Macro? I have written a Macro that hides rows on a worksheet that have zero
value, I run the Macro through a form button. However, when I protect the
worksheet so the hide/lock feature takes effect, it takes away my ability to
run the Macro. Any ideas how to run my Macro but still be able to hide and
lock my cells containing certain formulas?

Thanks in advance.- Hide quoted text -

- Show quoted text -




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to lock and unlock a cell using formulas in excel Ridhi Excel Discussion (Misc queries) 1 April 19th 08 11:33 AM
Lock formulas in a cell [email protected] Excel Discussion (Misc queries) 6 July 26th 07 05:00 AM
Hide Underlying Cell Formulas robben5 Excel Discussion (Misc queries) 1 August 17th 06 06:54 AM
How do I lock cell formulas??? John - Menifee, CA Excel Discussion (Misc queries) 2 May 16th 06 12:09 AM
Range Name affecting speed of macro Richard Buttrey Excel Worksheet Functions 5 May 1st 06 03:06 PM


All times are GMT +1. The time now is 03:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"