English 中文(简体)
条件格式格式化,全行基于
原标题:Conditional formatting, entire row based
  • 时间:2012-05-22 16:09:18
  •  标签:
  • excel-2010

我搜索和阅读了有关有条件格式的答案, 但我似乎无法让我的工作, 所以也许我做错了什么。

我有一份工作工作表。 它包含我们庇护所中的动物清单。 我试图做的是, 如果它们被采纳( 在“ G” 栏中用“ X” 表示为“ X ” ), 则将整个行的绿色涂色( 由“ X” 栏中用“ X” 表示) 。 我曾经有 < codeç$ G2=“ X” 和 < code\\ $ G2=“ X”, 但不工作 。 它只会将我设置规则时激活的一行涂色, 而当我在另一行输入“ X” 时, 它什么都不做 。 我缺少什么?

最佳回答
=$G1="X"

将会是正确( 和最简单) 的方法。 请先选择整个工作表, 因为有条件格式只对选定单元格有效。 我刚刚尝试过它, 并且它完全有效 。 您必须从 G1 开始而不是 G2 开始, 否则它会用行来抵消有条件格式 。

问题回答

在有条件格式化时使用“间接”函数。

  1. Select Conditional Formatting
  2. Select New Rule
  3. Select "Use a Formula to determine which cells to format"
  4. Enter the Formula, =INDIRECT("g"&ROW())="X"
  5. Enter the Format you want (text color, fill color, etc).
  6. Select OK to save the new format
  7. Open "Manage Rules" in Conditional Formatting
  8. Select "This Worksheet" if you can t see your new rule.
  9. In the "Applies to" box of your new rule, enter =$A$1:$Z$1500 (or however wide/long you want the conditional formatting to extend depending on your worksheet)

对于有 X 的 G 列中的每一行,它现在将转向您指定的格式。如果列中没有 X,则该行将不会被格式化。

您可以重复此选项, 根据列值进行多行格式化。 只要在公式中更改 < code> g 列或 < code> < x 具体文本, 并设定不同的格式 。

例如,如果在公式中添加新规则,即INDRANSLATORS (“h” & amp; ROW ()) =“CAR” ,那么它会按照您指定的格式,格式化在 H 列中有 CAR 的每行。

要根据单个单元格为 EntIRE ROW 设定条件格式,您必须设置单单元格的单单元格列地址为“$”,否则Excel 只能对第一列进行更正。 为什么?

因为 Excel 正在根据列的 OFFSET 设置您对行第二列的有条件格式。 对于第二列, Excel 现已将一列移动到您想要的规则单元格右侧, 检查了该单元格, 并根据您从未想要的单元格正确格式化了第二列 。

简单地把规则细胞地址的COLUMN部分 固定在"$"上,你会很高兴的

For example: You want any row of your table to highlight red if the last cell of that row does not equal 1.

Select the entire table (but not the headings) "Home" > "Conditional Formatting" > "Manage Rules..." > "New Rule" > "Use a formula to determine which cells to format"

Enter: "=$T3<>1" (no quotes... "T" is the rule cell s column, "3" is its row) Set your formatting Click Apply.

确保Excel没有将引号插入您的公式的任何部分... 如果插入的话, 反空格/ 删除它们( 请不使用箭头键 ) 。

应为整个表格设定有条件的格式。

您想要应用自定义格式规则。 “ 应用到” 字段应该是整个行( 如果您想要格式化第5行, 请在 < code_$5: $5 中插入) 。 自定义公式应该是 , 请在下面的示例中显示 。

“https://i.sstatic.net/nbXbV.png/> https://i.sstatic.net/nbXbV.png/>

使用 RC 地址 。 所以, 如果我要 B 栏的背景颜色取决于 C 栏的值, 并应用 2 至 20 行的背景颜色 :

步骤:

  1. 选择 R2C2 到 R20C2

  2. 点击附加条件格式

  3. 选择“ 使用公式确定要格式化的单元格”

  4. 公式中的类型: =RC[1] & gt; 25

  5. 创建您想要的格式( 即背景颜色“ 黄” )

  6. 应用到 : 请确认它写着 : = R2C2: R20C2

** Note that the "magic" takes place in step 4 ... using RC addressing to look at the value one column to the right of the cell being formatted. In this example, I am checking to see if the value of the cell one column to the right of the cell being formatting contains a value greater than 25 (note that you can put pretty much any formula here that returns a T/F value)

我想将E列的单元格值与G列的单元格值作比较。

突出显示要在列E中检查的单元格的选择。

Select Conditional Format: Highlight cell rules Select one of the choices in my case it was greater than. In the left hand field of pop up use =indirect("g"&row()) where g was the row I was comparing against.

现在您正在格式化的行将会根据是否大于 G 行所选区域而突出显示您正在格式化的行

相对于您为 E 列所选取的 G 列中的单元格, E 列中的每个单元格都可用此方法。

If G2 is greater than E2 it formats

G3 大于 E3 格式等





相关问题
Calling web service using VBA code in Excel 2010

I am trying to write some VBA code in Excel 2010 that would consume a web service. I am unable to find any related resources on the internet. Can someone please tell me how to do this.

How to get Excel version and macro security level

Microsoft has recently broken our longtime (and officially recommended by them) code to read the version of Excel and its current omacro security level. What used to work: // Get the program ...

Excel sparklines printing issue

In an Excel 2010 document with more than one page of records, where each row includes a sparkline, the sparklines do not print or appear in print preview unless one first scrolls through the entire ...

VS 2010 Excel Plugin - Getting Started

Ok so i want to build an Excel plugin (custom task pane) that ll act on the selected range in the active worksheet. Can t find any examples or documentation on how.

Loop this Excel Macro?

I have this code below, and basically I want to able to make it do a whole range of cells from R16 to R200 and Range("G16").Select to G200. i.e. when it changes to R17 then G16 becomes 17, when R18 ...

SUMIF bug in excel 2010

I ve just upgraded to Excel 2010 (it was free as I bought 2009 recently). I now don t have another version of excel to test it on but I think I ve discoved a SUMIF bug. Now I know the chances of me ...