option Explicit
Dim objExcel
Dim objWorkbook
Dim temp
GPTScript
Sub GPTScript
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("E:\1.xls")
objExcel.Visible = True
Call CopyRowToAnother(1, 2, 30) '把第一个sheet页面中的第2行复制到第30行
Call CopyColumnToAnother(1, 6, 30) ' 把第一个sheet页面中的第6列复制到第30列
Call CopyColumnsRangeToAnother(6, 5, 50) '从第6列开始的五列数据复制到50列之后的五列
End Sub
Sub CopyColumnsRangeToAnother(srcStartPos,columnNum, destStartPos)
Dim k
For k=1 To columnNum
Call CopyColumnToAnother(1, srcStartPos+k, destStartPos+k)
Next
End Sub
Sub CopyRowToAnother(sheetNum, row, anotherRow)
objExcel.worksheets(sheetNum).rows(row).copy(objExcel.worksheets(sheetNum).rows(anotherRow))
End Sub
Sub CopyColumnToAnother(sheetNum, columnNum, anotherColumn)
objExcel.Worksheets(sheetNum).Columns(columnNum).copy(objExcel.worksheets(sheetNum).Columns(anotherColumn))
End Sub