Hi Everyone,
I'm trying to find solution to dynamically lock cells in specified range, that would depend on the cell color, which would be driven by conditional formatting formulas.
In the attached file, the intent is to place $ amounts in columns "Land", "Sea", "Ocean", etc., however when the user insert amounts in "Land" column, it shouldn't allow input in "Sea" or "Ocean" column - they are going to become light grey. When user insert "Sea" amounts, it should forbid input in "Land" column, but allow "Ocean" inputs. Same is valid if the user first insert amounts in "Ocean" column (allow "Sea" but forbid "Land").
For exercise, I've placed VBA just for "Sea" column, which gives me error '1004' Unable to set the Locked property of the Range class.
I guess there can be multiple ways of doing this, but my vote goes to color rule (242, 242, 242), as I can have multiple combinations in multiple columns going forward, but this color is going to be strict rule to rely on.
Also, not sure how to share the xlsm file here, although I think it could be more helpful than screenshots that are added.
Any help is welcomed.
Tebrica
I'm trying to find solution to dynamically lock cells in specified range, that would depend on the cell color, which would be driven by conditional formatting formulas.
In the attached file, the intent is to place $ amounts in columns "Land", "Sea", "Ocean", etc., however when the user insert amounts in "Land" column, it shouldn't allow input in "Sea" or "Ocean" column - they are going to become light grey. When user insert "Sea" amounts, it should forbid input in "Land" column, but allow "Ocean" inputs. Same is valid if the user first insert amounts in "Ocean" column (allow "Sea" but forbid "Land").
For exercise, I've placed VBA just for "Sea" column, which gives me error '1004' Unable to set the Locked property of the Range class.
I guess there can be multiple ways of doing this, but my vote goes to color rule (242, 242, 242), as I can have multiple combinations in multiple columns going forward, but this color is going to be strict rule to rely on.
Also, not sure how to share the xlsm file here, although I think it could be more helpful than screenshots that are added.
Any help is welcomed.
Tebrica