vba VBA通过向左/向右移动来定位一行中出现的第一个空单元格
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23764894/
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
VBA locate the first empty cell that occurs in a row by moving left/right
提问by Codo
I have a Row
in Excel
and many cells of that row are populated by numbers, dates, etc.
我有一个Row
输入Excel
,该行的许多单元格都由数字、日期等填充。
Let us say this is Row 1
. However once we make a couple of moves in Row 1
to the left we find 3 or 4 empty cells and then continuing our move to the left on Row 1
the cells are populated again by various values.
让我们说这是Row 1
。然而,一旦我们Row 1
向左移动几次,我们就会发现 3 或 4 个空单元格,然后继续向左移动,Row 1
这些单元格再次填充了各种值。
How can i go to the first cell which is blank and empty that occurs, when we move to the left in Row 1
every time i fire up a macro?
Row 1
每次启动宏时,当我们向左移动时,如何转到第一个空白的单元格?
.____.____.___.___.___.____.____.____.____.____.
|_d__|_d__|___|___|___|__x_|_d__|_d__|_d__|_O__|
To put this schematicall if we areon O
how can we find/goto x
?
为了把这个schematicall如果我们对O
我们如何才能找到/进入到x
?
(Lets assume the x
is the first blank cell)
(假设x
是第一个空白单元格)
How can i go here
我怎么去这里
采纳答案by guitarthrower
This should move the selection there.
这应该将选择移到那里。
Selection.End(xlToLeft).Offset(0,-1).Select