Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
つまり、E2:W2 にデータがあり、列 A の行数に応じて E:W に貼り付けたいと考えています。マクロを実行するたびに、異なる行数になります。3行または2000行になる可能性があります
また、1 の可能性もあるため、コピーする必要はありません。
このようなものは、列Aに塗りつぶされたセルがなくなるまで、E2:W2をずっと下にコピーします
Sub CopyEW if cells(rows.count,1).end(xlup).row>2 then _ range("E2:W2").copy range("E2:W2").resize(cells(rows.count,1).end(xlup).row) end if end sub