我知道起始单元格,我需要通过列向下走。当下一个单元格为空时,我需要退出循环。如何在 VBA 代码中做到这一点?
感谢您的回复
最佳答案
怎么样;
'//get a range from anchor cell (a1) to the 1st empty cell in the same column;
dim r As Range, cell as Range
set r = Range(Range("A1"), Range("A1").End(xlDown))
'//loop it
for Each cell In r
msgbox cell.Value
next
关于excel - VBA如何遍历Excel中的列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7512843/