[英]Check if column B contains a specific string that exists in column A and then remove it from the cell in column B
So I want either an excel function or VBA script that searches through column B for a specific string that exists in column A, and then once there's a match I want to remove that string from the cell in column B and return the rest of the cell contents into column C.所以我想要一个 excel 函数或 VBA 脚本,它在 B 列中搜索 A 列中存在的特定字符串,然后一旦匹配,我想从 B 列中的单元格中删除该字符串并返回单元格的其余部分C 列的内容。
I can't use a simple "find and replace" because, as you can see in the picture, the text in each of the cells is in the form of an ID with an underscore followed by a random number appended to it.我不能使用简单的“查找和替换”,因为正如您在图片中看到的,每个单元格中的文本都是带有下划线的 ID 形式,后跟一个随机数。 And I have around 100,000 rows to search through.
我有大约 100,000 行要搜索。
An example table of what I'd like is shown below:我想要的示例表如下所示:
If the values you want to remove all have the pattern TL_xxxx
you can use wildcards to replace them.如果要删除的值都具有模式
TL_xxxx
,则可以使用通配符替换它们。
Ctrl-H to open the Find and Replace dialog, put TL_????
Ctrl-H 打开查找和替换对话框,输入
TL_????
into the Find what
box and leave the Replace with
box blank.进入
Find what
框并将Replace with
框留空。
You may need a second pass to replace two spaces or two line breaks with just one.您可能需要第二遍才能将两个空格或两个换行符替换为一个。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.