Sub 填充数据() Sheets("数据库").Select r = Selection.Row Dim arr() arr = Range("a" & r & ":l" & r) '填充第一列 Sheets("打印输出").Cells(2, 7) = arr(r, 2) Sheets("打印输出").Cells(2, 15) = arr(r, 2) Sheets("打印输出").Cells(2, 3) = arr(r, 1) Sheets("打印输出").Cells(2, 11) = arr(r, 1) Sheets("打印输出").Cells(3, 3) = arr(r, 3) Sheets("打印输出").Cells(3, 11) = arr(r, 3)
Sheets("打印输出").Cells(3, 7) = arr(r, 4) Sheets("打印输出").Cells(3, 15) = arr(r, 4)
Sheets("打印输出").Cells(4, 3) = arr(r, 5) Sheets("打印输出").Cells(4, 11) = arr(r, 5) Sheets("打印输出").Cells(5, 3) = arr(r, 6) Sheets("打印输出").Cells(5, 11) = arr(r, 6)
Sheets("打印输出").Cells(6, 3) = arr(r, 7) + " " + arr(r, 8) Sheets("打印输出").Cells(6, 11) = arr(r, 7) + " " + arr(r, 8) Sheets("打印输出").Cells(7, 3) = arr(r, 9) + " " + arr(r, 10) Sheets("打印输出").Cells(7, 11) = arr(r, 9) + " " + arr(r, 10)
Sheets("打印输出").Cells(8, 3) = arr(r, 11) Sheets("打印输出").Cells(8, 11) = arr(r, 11)
Sheets("打印输出").Cells(8, 7) = arr(r, 12) Sheets("打印输出").Cells(8, 15) = arr(r, 12)
End Sub 请问错误在哪里,(下标越界!) |