vba 搜索和突出显示多个值
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24496676/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Searching & Highlighting Multiple Values
提问by user3791278
I have two workbooks open, one with a master list of 4280 survey ID #s & one with a select group of about 420 survey ID #s (called "DNAs").
我打开了两本工作簿,一本包含 4280 个调查 ID # 的主列表,另一本包含大约 420 个调查 ID #(称为“DNA”)的精选组。
The master list includes all of the DNA survey IDs. I would like to search for the DNA survey IDs in the master list to highlight them and add this DNA code. Is there a way to do this all at once instead of individually?
主列表包括所有 DNA 调查 ID。我想在主列表中搜索 DNA 调查 ID 以突出显示它们并添加此 DNA 代码。有没有办法一次性完成这一切而不是单独完成?
When I used different formulas given in other answers, I did not get what I needed. Here is a similar situation to mine:
当我使用其他答案中给出的不同公式时,我没有得到我需要的。这是与我类似的情况:
how to search for multiple values in one excel sheet and copy it to another sheet
回答by Mark Balhoff
I think this conceptually is what you want. You can replace with your cell references, etc. The formula in the formula bar is in cell F1. The final parameter (0) of the MATCH function tells it to look for that exact value. The ISERROR function will return TRUE if the value is successfully found in the other workbook. The conditional formatting rule in the screenshot is applied to range $E$1:$E$9.
我认为这在概念上就是你想要的。您可以替换为您的单元格引用等。编辑栏中的公式位于单元格 F1 中。MATCH 函数的最后一个参数 (0) 告诉它寻找那个确切的值。如果在其他工作簿中成功找到该值,则 ISERROR 函数将返回 TRUE。屏幕截图中的条件格式规则适用于 $E$1:$E$9 范围。
回答by mrbungle
I found the top answer from hereto be quite useful when I was attempting something similar and It worked great. I coulnd't find my old example that pertained to my particular problem but if you do any VBA you should be able to tweak it to your needs. Best I could provide. Good luck.
当我尝试类似的事情时,我发现这里的最佳答案非常有用,并且效果很好。我找不到与我的特定问题有关的旧示例,但是如果您执行任何 VBA,您应该能够根据需要对其进行调整。我能提供的最好的。祝你好运。