ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   lock cells based on formula result (https://www.excelbanter.com/excel-discussion-misc-queries/163620-lock-cells-based-formula-result.html)

Mike

lock cells based on formula result
 
I have a formula in Column O7:O37 of a spreadsheet. I need cells B7:N37 to
lock when the value from the formula exceeds a certain threshold. Is this
possible?


Thanks for the help,
Mike



JLatham

lock cells based on formula result
 
Possible, but a little difficult. Ordinarily this would be handled through
some VBA code (macro) based on an event triggering on the sheet, such as a
value in one of the O7:O37 cells changing. However, changes caused by a
formula don't trigger the event. What has to be done is track back through
those formulas to find where a value is entered/changed within the workbook
that affects the results of those cells. Then some Worksheet_Change() event
handling at that point can be done to deal with:
unprotecting the sheet,
locking the appropriate column B:N cell(s)
putting the sheet back into protected state so that the locks take effect.

The other side of the coin is when do you UNLOCK those cells after they've
been locked down?

But, yes, in theory it's possible to do what you want.

"MIke" wrote:

I have a formula in Column O7:O37 of a spreadsheet. I need cells B7:N37 to
lock when the value from the formula exceeds a certain threshold. Is this
possible?


Thanks for the help,
Mike




All times are GMT +1. The time now is 06:11 AM.

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