Data Validation cell lock if value is true (Google Spreadsheet)

左心房为你撑大大i 提交于 2020-01-24 00:37:06

问题


I am currently working now on creating data validation in google spreadsheet, and I want to lock a certain cell based on the value of the other cell in another spreadsheet.

Scenario: (Based on the Image)

There are 2 different spreadsheets (Sample1 & Sample 2) with has the same column H which is Status and the same Cell H2 which is Dropdown list (Active and Inactive).

on Sample1 Cell H2, If I choose Inactive, I want the Sample2 Cell H2 to be locked, otherwise if on Sample1 Cell H2 If I choose Active, the Sample2 Cell H2 should be remain as dropdown list.

Thanks in advance.


回答1:


I assume you don't want to lock the cell as in protecting it.
You can't remove the data validation but you can give it an empty set.

The easiest approach for this kind of thing is to add a Control sheet that handles this.
It may be a bit overkill for this application but you could create proper interactive menus in this fashion that are more complex and contain more options on the dependent and the independent side.

  ____A_________B_________C____
1|   Active| Inactive| Current|       
2|   Active|         |        |
3| Inactive|         |        |

With cell C2 getting the formula

=INDEX(A2:B3, , MATCH(Sample1!H2, A1:B1, 0))

And the Data validation in Sample2!H2 referring to Control!C2:C3



来源:https://stackoverflow.com/questions/39267085/data-validation-cell-lock-if-value-is-true-google-spreadsheet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!