使用Excel中的条件格式链接到另一个工作簿

问题描述:

如何使用条件格式从其他工作簿中提取数据?

How can i use conditional formatting to extract data from other workbook?

我试过:

=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.

让我们调用工作簿您要输入条件格式为MyWbk,另一个为SrcWbk。此说明适用于excel 2007.您的里程可能会有所不同。

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.


  1. 打开两个工作簿

  1. Open both Workbooks

在MyWbk中,转到公式菜单,然后选择定义名称

In MyWbk go to the Formulas Menu, and select Define Name

输入名称> testname

Enter in Name > testname

在引用字段中,选择点击范围选择器(右侧),选择器打开时,选择SrcWkb,然后选择要作为格式条件的源的单元格。

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.

接受创建名称

转到要输入的单元格条件格式

Go to the cell where you want to enter the conditional format

选择主菜单/条件格式/管理规则

Select the Home Menu / Conditional Formatting / Manage Rules

输入新规则

选择使用公式确定要格式化的单元格

Select "Use a formula to determine which cells to format"

输入你想要的公式,使用定义的名称。例如
= IF(testname = 1,TRUE)

Enter the formula you want, using the defined name. For example =IF(testname=1,TRUE)

选择所需的格式

测试公式更改SrcWbk中的值

Test the formula changing the value in SrcWbk

保存SrcWbk

你完成了!