Dim app AsNew Excel.Application app.Visible =True Dim book As Excel.Workbook = app.Workbooks.Add() Dim sheet As Excel.Worksheet= book.Sheets(1) For i AsInteger=1To1000 For j AsInteger=1To26 sheet.Cells(i, j).Value ="R"& i &"C"& j Next Next
之后代码:
Dim app AsNew Excel.Application app.Visible =True Dim book As Excel.Workbook = app.Workbooks.Add() Dim sheet As Excel.Worksheet= book.Sheets(1) Dim ary AsObject(,) = sheet.Range("A1:Z1000").Value For i AsInteger=1To1000 For j AsInteger=1To26 ary(i, j) ="R"& i &"C"& j Next Next sheet.Range("A1:Z1000").Value = ary