簡単な例として、空のセルに到達するまで、列の 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
サブ終了