在 Excel 中使用条件格式链接到另一个工作簿
如何使用条件格式从其他工作簿中提取数据?
我尝试过:
=IF(LEFT(B26,3)="SSS",VLOOKUP(B26,'XXX.xls!$A$4:$E$119,4,FALSE))
但我收到此错误消息:
您不得通过条件格式链接到其他工作簿
对于这种情况我该怎么办?人们提到“定义名称”,但我不确定如何做到。
How can i use conditional formatting to extract data from other workbook?
I tried:
=IF(LEFT(B26,3)="SSS",VLOOKUP(B26,'XXX.xls!$A$4:$E$119,4,FALSE))
But I get this error message:
You may not link to other workbook via conditional formatting
What can I do with this situation? People out there mentioned "define name" but I'm not sure how can it be done.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
让我们将要输入条件格式的工作簿称为 MyWbk,将另一个称为 SrcWbk。本说明适用于 Excel 2007。您的情况可能会有所不同。
打开两个工作簿
在 MyWbk 中转到“公式”菜单,然后选择“定义名称”
输入名称> testname
在“引用”字段中,选择单击范围选择器(右侧),当选择器打开时,选择 SrcWkb,然后选择要作为格式条件源的单元格。
接受名称创建
转到要输入条件格式的单元格
选择主菜单/条件格式/管理规则
输入新规则
选择“使用公式确定要设置格式的单元格” ”
使用定义的名称输入所需的公式。例如
=IF(testname=1,TRUE)
选择所需的格式
测试更改 SrcWbk 中的值的公式
保存 SrcWbk
您已完成!
Lets call the workbook where you want to enter the conditional format as MyWbk and the other one SrcWbk. This instructions are for excel 2007. Your mileage may vary.
Open both Workbooks
In MyWbk go to the Formulas Menu, and select Define Name
Enter in Name > testname
In the "Refers to" field, select click on the range selector (at right) and when the selector opens, select SrcWkb and then the cell you want as source for the format condition.
Accept the name creation
Go to the cell where you want to enter the conditional format
Select the Home Menu / Conditional Formatting / Manage Rules
Enter New Rule
Select "Use a formula to determine which cells to format"
Enter the formula you want, using the defined name. For example
=IF(testname=1,TRUE)
Select the desired formatting
Test the formula changing the value in SrcWbk
SAVE SrcWbk
You are done!
我刚刚遇到了这个。 Excel 2013 中仍然存在该限制。
但有一个解决方法。
该限制仅存在于条件格式编辑器中。
条件格式本身工作得很好。
因此,在编辑器中,您无法引用引用另一个工作簿的定义范围。您必须创建引用当前工作簿的命名范围,定义使用它的条件格式,然后在完成调试后,将定义的范围更改为其他工作簿。
这并不像听起来那么糟糕,因为无论如何在同一张纸中调试格式更容易。
只有当您想稍后返回并更改格式时,这才是真正的痛苦。
I just ran into this. The limitation is still there in Excel 2013.
But there is a workaround.
The limitation only exists in the Conditional Formatting editor.
The conditional formatting itself works just fine.
So in the editor, you can't refer to a defined range that refers to another workbook. You have to create the named range referring to your current workbook, define the conditional formatting that uses it, then when you are finished debugging it, change the defined range to the other workbook.
This isn't as bad as it sounds because it is easier to debug your formatting within the same sheet anyway.
This is only really a pain when you want to go back and change your formatting later.