简体   繁体   English

如何在Excel中锁定单元格

[英]How to lock a cell in excel

I have a cell which has a formula in it and it also has a dropdown. 我的单元格中有一个公式,并且还包含一个下拉列表。 Is it possible to lock the cell for the formula but still allow user to select the dropdown. 是否可以锁定公式的单元格,但仍允许用户选择下拉列表。 Is this possible without macro? 没有宏,这可能吗?

What you want is a common request for some business models. 您想要的是某些业务模型的常见要求。 Say A1 has a complex formula to calculate price. 假设A1有一个复杂的公式来计算价格。 The formula is based on cost, overhead rates, sales tax, shipping costs, and desired profit. 该公式基于成本,间接费用,营业税,运输成本和期望的利润。 Because is complex, we need to protect the cell. 因为很复杂,我们需要保护细胞。

However, for certain customers, we need to ignore the formula and use a pull-down to get the price. 但是,对于某些客户,我们需要忽略公式,并使用下拉菜单来获取价格。 The solution is to use three cells. 解决方案是使用三个单元。

A1 contains the formula and is protected. A1包含公式,并且受保护。 A2 contains a set of pull-down values. A2包含一组下拉值。 The third cell contains the formula: 第三个单元格包含以下公式:

=IF(A2="",A1,A2)

This says that if ther is no over-ride value, use the formula. 这表示如果ther没有超越值,则使用公式。 If ther is an over-ride value, use it instead. 如果ther是一个超越值,请改用它。

You can right click on the cell and select lock cell. 您可以右键单击该单元格,然后选择锁定单元格。 There are various options that you can choose to lock, Examine the tickbocks and select what you want. 您可以选择锁定各种选项,检查刻度线,然后选择所需的选项。 When you have made your choices you then need to protect the worksheet to activate your settings. 做出选择后,您需要保护工作表以激活您的设置。

Here is what you want to look at on office.com 这是您想在office.com上看到的内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM