Sub RowRangeMove()
Sheets.Add().Name = "CopySheet"
With Sheets("BigDataSet - Copy")
.Range("A65000", .Range("A13000").End(xlUp)).Copy Destination:=Range("A1")
With Sheets("BigDataSet - Copy")
.Range("B65000", .Range("B13000").End(xlUp)).Copy Destination:=Range("B1")
With Sheets("BigDataSet - Copy")
.Range("C65000", .Range("C13000").End(xlUp)).Copy Destination:=Range("C1")
With Sheets("BigDataSet - Copy")
.Range("D65000", .Range("D13000").End(xlUp)).Copy Destination:=Range("D1")
With Sheets("BigDataSet - Copy")
.Range("E65000", .Range("E13000").End(xlUp)).Copy Destination:=Range("E1")
With Sheets("BigDataSet - Copy")
.Range("F65000", .Range("F13000").End(xlUp)).Copy Destination:=Range("F1")
With Sheets("BigDataSet - Copy")
.Range("G65000", .Range("G13000").End(xlUp)).Copy Destination:=Range("G1")
With Sheets("BigDataSet - Copy")
.Range("H65000", .Range("H13000").End(xlUp)).Copy Destination:=Range("H1")
With Sheets("BigDataSet - Copy")
.Range("I65000", .Range("I13000").End(xlUp)).Copy Destination:=Range("I1")
With Sheets("BigDataSet - Copy")
.Range("J65000", .Range("J13000").End(xlUp)).Copy Destination:=Range("J1")
End With
.
.
[iterate several times]
.
.
Sheets.Add().Name = "CopySheet7"
With Sheets("BigDataSet - Copy")
.Range("A455006", .Range("A502750").End(xlUp)).Copy Destination:=Range("A1")
With Sheets("BigDataSet - Copy")
.Range("B455006", .Range("B502750").End(xlUp)).Copy Destination:=Range("B1")
With Sheets("BigDataSet - Copy")
.Range("C455006", .Range("C502750").End(xlUp)).Copy Destination:=Range("C1")
With Sheets("BigDataSet - Copy")
.Range("D455006", .Range("D502750").End(xlUp)).Copy Destination:=Range("D1")
With Sheets("BigDataSet - Copy")
.Range("E455006", .Range("E502750").End(xlUp)).Copy Destination:=Range("E1")
With Sheets("BigDataSet - Copy")
.Range("F455006", .Range("F502750").End(xlUp)).Copy Destination:=Range("F1")
With Sheets("BigDataSet - Copy")
.Range("G455006", .Range("G502750").End(xlUp)).Copy Destination:=Range("G1")
With Sheets("BigDataSet - Copy")
.Range("H455006", .Range("H502750").End(xlUp)).Copy Destination:=Range("H1")
With Sheets("BigDataSet - Copy")
.Range("I455006", .Range("I502750").End(xlUp)).Copy Destination:=Range("I1")
With Sheets("BigDataSet - Copy")
.Range("J455006", .Range("J502750").End(xlUp)).Copy Destination:=Range("J1")
End With
End Sub
これを実行しようとすると、「EndWithを期待しています」というエラーが表示されます。スクリプトの目的は、行の範囲をコピーして、それらを新しい個別のシートに配置することです(その後、最大行数を超えずにExcel 2003で読み取る個別のファイルに配置できます)。このどこかに1つ以上の追加のEndWithステートメントが必要ですか?