是否可以在包含公式的单元格中键入内容而不删除公式对该单元格的作用?
是否可以在已有公式的单元格中输入内容?
我将在这里更详细地讨论
相关单元格中的公式,当另一个工作表中输入了值时,该公式将与该单元格中的结果相匹配。
是否可以在此单元格中输入文本但保留公式,以便当单元格为空时公式保留并仍然显示结果?
Is it possible to be able to type in a cell that already has a formula in it?
I'll go into a bit more detail here
The cell in question has a formula in it that when another sheet has a value typed in it is matched with the result into the said cell.
Is it possible type in this cell with text but keeping the formula so when the cell is blank the formula stays and still displays the result?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法完全按照您的要求进行操作,但您可以使用一些 VBA 代码,在每次清除单元格时将公式替换回单元格中。
您可以使用
Worksheet_Change
事件 (MS 文档页面)。每次更改下面代码所在的工作表(假设为Sheet1
)时,它都会检查任何更改的单元格是否在C1:C10
范围内,并且,如果它们为空,请输入引用该单元格中sheet2
中相同单元格地址的公式。如果您想使用它,您将需要更改代码,以便它影响您想要的单元格,并提供您实际正在寻找的公式(因为您没有说出其中任何一个是什么)。
You can't do exactly what you are asking for, but you can have some VBA code that will replace the formula back in a cell every time it is cleared.
you would do this using the
Worksheet_Change
event (MS Docs page here). Every time the worksheet the code below is in (assumed to beSheet1
) is changed, it will check if any of the changed cells are in the rangeC1:C10
and, if they are empty, enter a formula that refers to the same cell address insheet2
in that cell.If you want to use this, you will need to alter the code so it affects the cells you want it to, and provides the formula you are actually looking for (as you dont say what either of those are).