从 Excel VBA 中的范围中获取第一列范围
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15974367/
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 15:23:29 来源:igfitidea点击:
Get a first column range from a range in Excel VBA
提问by NCC
I would like to get a column range (the first column) from a range, example: If the Range: $E$9:$I$259 The result : $E$9:$E259
我想从范围中获取列范围(第一列),例如:如果范围:$E$9:$I$259 结果:$E$9:$E259
How could I achieve this?
我怎么能做到这一点?
回答by Dave Sexton
By using the columns collection of the range object like so:
通过使用范围对象的列集合,如下所示:
Range("$E:$I9").Columns(1)