• 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

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
icon_wink.gif



I appreciate your help. Thanks!
 

Attachments

  • Core dup.xlsx
    18.3 KB · Views: 7
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

  • Core dup (PB).xlsx
    22.7 KB · Views: 10
@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.
 
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

  • Core dup.xlsb
    23.8 KB · Views: 2
  • Core dup.xlsm
    27.3 KB · Views: 6
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
 
rupal1234
... and if You click B4 any time and
do or try to do selection
... what would happen or not?
 

Attachments

  • Core dup.xlsb
    25.4 KB · Views: 0
  • Core dup.xlsm
    28.9 KB · Views: 3
Back
Top