Excel-VBA:Range 函数中的“&”是什么意思

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

Excel-VBA: What's the meaning of "&" in Range function

vbaexcel-vbaexcel

提问by Meysam

What's the meaning and usage of "&" in the following piece of code?

下面这段代码中“&”的含义和用法是什么?

Set Rng = Range("a1", Range("h" & Rows.Count).End(xlUp)) 

回答by j.w.r

&is the string concatenation operator in VBA. So if Rows.Count= 10 then "h" & Rows.Countwould produce a string that contains "h10".

&是 VBA 中的字符串连接运算符。所以如果Rows.Count= 10 那么"h" & Rows.Count会产生一个包含“h10”的字符串。