vba 引用单元格内的 Excel 地址,但也引用附加文本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2232068/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 10:16:01  来源:igfitidea点击:

Referencing an Excel address within a cell, but also additional text

excelvbaexcel-vba

提问by notnot

I want to be able to insert a reference into a cell with arbitrary text around it.

我希望能够将引用插入到带有任意文本的单元格中。

ex. use a reference to cells A1, B1

前任。使用对单元格 A1、B1 的引用

  C1 => "blah blah <A1 text> foobar <B1 text>"

Is there any way to do something like this while still maintaining the references?

有没有办法在保持引用的同时做这样的事情?

回答by mechanical_meat

You have a couple of options:

你有几个选择

& operator:

& 操作员:

="blah blah " & A1 & " foobar " & B1

or CONCATENATE():

或连接():

=CONCATENATE("blah blah ",A1," foobar ",B1)

回答by shahkalpesh

=CONCATENATE("blah blah ", A1, " foobar ", B1)

Put the above formula in cell C1.

将上述公式放在单元格C1中。