简体   繁体   English

如果另一个单元格包含 Excel 中的字符串,如何为特定单元格着色?

[英]How to color specific cells if another cell contains a string in Excel?

I am trying to change the fill and font color of only A2 and B2 if E2 contains the string "departments" for example.例如,如果 E2 包含字符串“部门”,我正在尝试仅更改 A2 和 B2 的填充和字体颜色。

I have found formulas that highlight the whole row, but I only want select cells of the row while actually formatting with colors, and I can't quite get it right with conditional formatting.我找到了突出显示整行的公式,但我只想在实际使用颜色进行格式化时选择该行的单元格,并且我无法完全正确地使用条件格式。

Any help would be appreciated.任何帮助,将不胜感激。

Use a rule based on the following formula:使用基于以下公式的规则:

=SEARCH("departments",$E1)>0

and apply it to columns A and B.并将其应用于 A 列和 B 列。

在此处输入图片说明

You can also simplify the formula to just =SEARCH("departments",$E1)您还可以将公式简化为=SEARCH("departments",$E1)

暂无
暂无

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

相关问题 Excel VBA:当另一个单元格包含特定文本或字符串时,如何清除指定单元格的内容 - Excel VBA: How to clear contents for specified cells when another cell contains specific text or string excel对另一个单元格包含字符串的所有单元格求和 - excel sum all cells where another cell contains a string 如何匹配包含特定文本的单元格并在excel中对其进行颜色编码 - how to match cells that contains specific text and color code them in excel Excel VBA选择一个单元格区域,直到一个单元格包含特定文本 - Excel VBA Select a Range of Cells Until a Cell Contains Specific Text 如果另一个单元格包含 Excel 中的特定文本,则在一个单元格中生成一个值 - Produce a value in one cell, if another cell contains a specific text in Excel 如果另一个单元格包含特定字符/字符串或其部分,如何合并两个单元格的内容 - How to combine the contents of two cells if a another cell contains specific characters/strings or parts thereof "Excel VBA:检查范围是否包含具有特定颜色的单元格" - Excel VBA: Checking if range contains a cell with a specific color Excel-如何根据其颜色和相邻单元格的颜色对单元格进行计数? - Excel - How to count cells depending on its color and the color of an adjacent cell? Excel:如何在包含字符串的列中查找单元格并在另一列行中返回单元格的值? - Excel: How to find cell in a column that contains a string and return value of a cell in another column of row? 如何根据excel中另一个工作表单元格值的特定值填充单元格背景颜色? - How to Fill cell background color depending a specific value from another sheet cell value in excel?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM