举个简单的例子,我必须选择一列中的每 22 个单元格,直到找到一个空单元格。我需要能够将所有这些单元格复制到剪贴板以粘贴到另一个电子表格中。我可以正确选择每个单元格,但不知道如何将它们收集到一个要复制的对象中。
盯着看的评论需要代码。
子 SelectAllValidCells()
' select first cell
[J15].Select
' Test contents of active cell; if active cell is empty, exit loop.
Do Until IsEmpty(ActiveCell)
' ***** need to figure out how to gather the valid cells
' here to later copy to clipboard when we reach empty cell
' Step down 22 rows to the next cell.
ActiveCell.Offset(22, 0).Select
' Return to top of loop.
Loop
'***** copy gathered cells to clipboard
结束子