vba 多次使用替代功能,但应将结果合并在一列和单元格中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16490815/
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
multiple use of substitute function but it should combine the results in one column and cell
提问by Rajmakbul
please check the picture link to understand the query **
请查看图片链接了解查询**
I want to combine the multiple raw into one text string , I can use substitute function to change one word in a text string but how can i use the same function to change multiple text in the same raw ? Please check the below picture
我想将多个原始文本组合成一个文本字符串,我可以使用替换函数来更改文本字符串中的一个单词,但是如何使用相同的函数来更改同一原始文本中的多个文本?请检查下面的图片
Raw 4 is a old text and i want to change three word of that raw and results should be like last raw, I guess picture is pretty clear to understand this.
Raw 4 是一个旧文本,我想更改那个 raw 的三个单词,结果应该和 last raw 一样,我想图片很清楚理解这一点。
I would appreciate if anyone can help in this , Please check the below picture
如果有人可以帮忙,我将不胜感激,请查看下图
http://3.bp.blogspot.com/-239FYyB8zC8/UY1dJC9eU7I/AAAAAAAAAU0/XlfBWN0k9Ts/s1600/Excel.jpg
http://3.bp.blogspot.com/-239FYyB8zC8/UY1dJC9eU7I/AAAAAAAAAU0/XlfBWN0k9Ts/s1600/Excel.jpg
回答by Daniel M?ller
Use the substitute
inside another substitute
inside another substitute
.
用substitute
里面另一个substitute
里面另一个substitute
。
Should look like:
应该看起来像:
= substitute(substitute(substitute(text; oldtext; newtext); oldtext2; newtext2); oldtext3; newtext3)
In your specific case:
在您的具体情况下:
= substitute(substitute(substitute(D2; "ABC"; A2); "DEF"; B2); "JKL"; C2)