• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Lock and unlock cells based on condition

rupal1234

New Member
I want to give the user options which are conditional on another cell. For example, in cell B4 is a dropdown of numbers:If number is less than 12 than cell I4 will be grayed out, & be locked. And if number is greater than 12 than cell I4 will be unlocked




I guess I have to do something in visual basic but I never used it before, so I would appreciate it if you could explain every single step



I appreciate your help. Thanks!
 

Attachments

Peter Bartholomew

Well-Known Member
I do not think locking is relevant to the problem you have described. That simply prevents the user from changing or overwriting your formula.

In the attached I have conditionally formatted the cell so that zeros are greyed out and the number format either renders 0 as a blank or "N/A" meaning 'not available'.

Sorry about changing your formulas to structured references; I have a blind spot when it comes to reading direct references - it is all a jumble of meaningless characters to me ;).
 

Attachments

Peter Bartholomew

Well-Known Member
@vletm
You have done what the OP requested but I still struggle to see the point (by the way, I liked the ASE routine). Unlocking a formula cell achieves nothing of value whilst the formatting could equally be achieved using conditional formatting.
 

vletm

Excel Ninja
rupal1234
It would be ... to get needed parameters in one time.
Even 'minor' change would mean a lot of changes...
... as You would notice.

Peter Bartholomew
True, sometimes 'the point' would be challenge to find out ...
In this time, OP uses terms 'locked'
... so OP got 'locked' and that can use this way too.
 

Attachments

rupal1234

New Member
rupal1234
It would be ... to get needed parameters in one time.
Even 'minor' change would mean a lot of changes...
... as You would notice.

Peter Bartholomew
True, sometimes 'the point' would be challenge to find out ...
In this time, OP uses terms 'locked'
... so OP got 'locked' and that can use this way too.

In this when i click on g4 and select ground wire than it should lock cell I4 and if i click on flat strip then it should hide H4
 
Top