简体   繁体   English

如何基于同一行中的另一个单元格突出显示列中单元格值的所有实例?

[英]How to highlight all instances of a cell value in a column based on another cell in same row?

I am trying to use either CONDITIONAL FORMATTING or VBA to achieve the following.我正在尝试使用条件格式或 VBA 来实现以下目标。

Let's assume columns A and B假设 A 列和 B 列
Column A contains a list of locations and are duplicated many times, eg. A 列包含一个位置列表,并且重复了很多次,例如。 the location "ANYWHERE" could be in 20 different rows (but in the same column).位置“ANYWHERE”可以在 20 个不同的行中(但在同一列中)。
Column B contains a Vlookup code that results in a numerical value (including 0) or are blank. B 列包含一个 Vlookup 代码,该代码产生一个数值(包括 0)或为空白。

I want IF column B contains a value that is NOT 0 to highlight ALL INSTANCES of the same location in column A (even if the value is blank or 0 in column B).我希望 IF 列 B 包含一个非 0 的值,以突出显示 A 列中相同位置的所有实例(即使 B 列中的值为空白或 0)。

So if on row 300, there is a location 'ANYWHERE' and column B (for that row) has a value of '10' then highlight EVERY instance of the word "ANYWHERE" in column A (below and above).因此,如果在第 300 行,有一个位置“ANYWHERE”并且 B 列(该行)的值为“10”,则突出显示 A 列(上下)中单词“ANYWHERE”的每个实例。

I got halfway there with conditional formatting to highlight the value in column A for any value that is not blank or higher than 0 in column B, but I do not know how to highlight all instances of that value in column A.我到了一半,使用条件格式来突出显示 A 列中任何非空白值或 B 列中不大于 0 的值,但我不知道如何突出显示 A 列中该值的所有实例。

Also, if in row 100, 'ANYWHERE' has a value of '20' in column B (and thus all instances of "ANYWHERE" get highlighted, and then in row 200 'ANYWHERE' has no value in column B, that instance of 'ANYWHERE' should NOT get UN-highlighted此外,如果在第 100 行中,“ANYWHERE”在 B 列中的值为“20”(因此“ANYWHERE”的所有实例都被突出显示,然后在第 200 行中,“ANYWHERE”在 B 列中没有值,该实例“任何地方”都不应被取消突出显示

The values in the first column should be highlighted based on the value in the last column.第一列中的值应根据最后一列中的值突出显示。
In this case, everything with NM-5F-0335 should be highlighted在这种情况下,应突出显示带有 NM-5F-0335 的所有内容
在此处输入图像描述

Here is the formula: =COUNTIFS($A$1:$A$12,$A1,$B$1:$B$12,"<>0")>0这是公式: =COUNTIFS($A$1:$A$12,$A1,$B$1:$B$12,"<>0")>0

Screenshot for example:截图例如:

在此处输入图像描述

暂无
暂无

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

相关问题 根据同一行中另一个单元格的文本颜色设置一个单元格的值 - Set value of a cell based on the text color of another cell on the same row 如果在另一列上找到一个单元格的值,如何从与同步单元格在同一行的另一列返回该单元格的值? - If a cell's value is found on another column, how to return the cell's value from another column which is on same row with the synced cell? 如果所有单元格值都相同,则突出显示整行 - Highlight entire row if all cell values are the same Excel:如何根据同一行中的另一个单元格锁定一个单元格 - Excel: How to lock a cell based on another cell in the same row 根据 Excel 中的单元格值突出显示行 - Highlight row based on cell value in Excel 用于根据同一行中的另一个单元格值过滤行中的单元格的 VBA - VBA for filtering cells in a row based on another cell value in the same row 如何根据另一个像元值​​VBA突出显示一个像元? - How to highlight a cell based on another cells value VBA? 从与另一行中的单元格相对应的行中获取值(在同一列中) - Get value from a row that corresponds (in the same column) to a cell in another row 突出显示另一个单元格中包含值的所有单元格 - Highlight all cells that contain a value in another cell 根据同一行中另一个单元格的值计算相应单元格中的单元格值 - Count cell values in corresponding cell based on the value of another cell in the same row
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM