[英]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 的所有内容
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.