ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Sheet Protection (https://www.excelbanter.com/excel-discussion-misc-queries/138680-sheet-protection.html)

OdAwG

Sheet Protection
 
Hello All,

I ws wondering on how I can protect a sheet that has nothing but formula's
in it. My Scenario is this:

I have a main sheet that I enter in all of my data into. from the other
sheets, I use vlookup and other formula's to pull data into them. The
problem that I am having is when I protect the whole sheet, then those cells
that I have formulas in them won't update when I run my upate macro because
they are protected. I don't want to un-protect those cells because, then a
user may accidentally del, change, or erase that formua.

Thanks in advance for any help

Argus



leung

Sheet Protection
 
Hi

In this case, you could unprotect it before the update and protect it again
afterward.

ActiveWorkbook.ActiveSheet.Protect
<call the update subroutine
ActiveWorkbook.ActiveSheet.Unprotect

hope this help.

Leung



"OdAwG" wrote:

Hello All,

I ws wondering on how I can protect a sheet that has nothing but formula's
in it. My Scenario is this:

I have a main sheet that I enter in all of my data into. from the other
sheets, I use vlookup and other formula's to pull data into them. The
problem that I am having is when I protect the whole sheet, then those cells
that I have formulas in them won't update when I run my upate macro because
they are protected. I don't want to un-protect those cells because, then a
user may accidentally del, change, or erase that formua.

Thanks in advance for any help

Argus




Dave Peterson

Sheet Protection
 
I think you have a different problem.

If your code tries to change a locked cell on a protected sheet, it would fail.
But if your locked cells on that protected sheet are formulas and they're not
reevaluating, it's not the cause of the macro.

Maybe you've changed calculation to manual in your code to speed things up??????


ps. You can protect a worksheet in code that allows your code to make changes
to those locked cells on that protected worksheet--but prevents the user from
doing so. But this won't help in this case.



OdAwG wrote:

Hello All,

I ws wondering on how I can protect a sheet that has nothing but formula's
in it. My Scenario is this:

I have a main sheet that I enter in all of my data into. from the other
sheets, I use vlookup and other formula's to pull data into them. The
problem that I am having is when I protect the whole sheet, then those cells
that I have formulas in them won't update when I run my upate macro because
they are protected. I don't want to un-protect those cells because, then a
user may accidentally del, change, or erase that formua.

Thanks in advance for any help

Argus


--

Dave Peterson


All times are GMT +1. The time now is 01:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com