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.
列と行を表すために長い変数を使用しています。タイプで範囲を指定しようとするとsheetname.range(cells(i,j), cells(i+1, j+1))、メソッドRange of Object Worksheet failedエラーが発生します。
sheetname.range(cells(i,j), cells(i+1, j+1))
Range of Object Worksheet failed
長い変数をセル参照として使用するときに範囲を使用する方法についてのアイデアはありますか?
sheetname.Range(sheetname.Cells(i,j), sheetname.Cells(i+1, j+1))
非修飾Cells()は常にアクティブなシートを参照します。
Cells()
私はむしろ使用したい:
sheetname.Cells(i,j).Resize(2,2)