vba 无论大小写,我们如何检查 MS-Excel 中的两行/列是否包含相同的文本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22164823/
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
How can we check if two rows/columns in MS-Excel contain same text, irrespective of the case?
提问by demouser123
I want to compare two rows or columns in MS-Excel 2013, to check if they have the same text.
我想比较 MS-Excel 2013 中的两行或两列,以检查它们是否具有相同的文本。
It somewhat like the EXACT() function but without being case sensitive.
它有点像 EXACT() 函数,但不区分大小写。
Like
喜欢
A1: Abcd
A1:ABCD
B1: abcd
B1: abcd
C1: True (result of matching)
C1:真(匹配结果)
Then the corresponding result should be true. I tried using EXACT() method, but it only returns true if I have exactly the same text (Abcd) in B1.
那么对应的结果应该是真的。我尝试使用 EXACT() 方法,但只有在 B1 中有完全相同的文本 (Abcd) 时它才会返回 true。
回答by Santosh
You may use any of below option
您可以使用以下任何选项
=A1=B1
or =EXACT(UPPER(A2),UPPER(B2))
=A1=B1
或者 =EXACT(UPPER(A2),UPPER(B2))