|
这段 代码 该如何 简化????
For j = 1 To 4 '填写表格数据
.ActiveDocument.Tables(1).Cell(2, 2).Range = Sheets("数据").Cells(i, j + 0)
.ActiveDocument.Tables(1).Cell(2, 4).Range = Sheets("数据").Cells(i, j + 1)
.ActiveDocument.Tables(1).Cell(3, 2).Range = Sheets("数据").Cells(i, j + 2)
.ActiveDocument.Tables(1).Cell(3, 4).Range = Sheets("数据").Cells(i, j + 3)
.ActiveDocument.Tables(1).Cell(4, 2).Range = Sheets("数据").Cells(i, j + 4)
.ActiveDocument.Tables(1).Cell(4, 4).Range = Sheets("数据").Cells(i, j + 5)
.ActiveDocument.Tables(1).Cell(5, 2).Range = Sheets("数据").Cells(i, j + 6)
.ActiveDocument.Tables(1).Cell(5, 4).Range = Sheets("数据").Cells(i, j + 7)
.ActiveDocument.Tables(1).Cell(6, 2).Range = Sheets("数据").Cells(i, j + 8)
.ActiveDocument.Tables(1).Cell(6, 4).Range = Sheets("数据").Cells(i, j + 9)
.ActiveDocument.Tables(1).Cell(7, 2).Range = Sheets("数据").Cells(i, j + 10)
.ActiveDocument.Tables(1).Cell(7, 4).Range = Sheets("数据").Cells(i, j + 11)
.ActiveDocument.Tables(1).Cell(8, 2).Range = Sheets("数据").Cells(i, j + 12)
.ActiveDocument.Tables(1).Cell(8, 4).Range = Sheets("数据").Cells(i, j + 13)
.ActiveDocument.Tables(1).Cell(9, 2).Range = Sheets("数据").Cells(i, j + 14)
.ActiveDocument.Tables(1).Cell(9, 4).Range = Sheets("数据").Cells(i, j + 15)
.ActiveDocument.Tables(1).Cell(10, 2).Range = Sheets("数据").Cells(i, j + 16)
.ActiveDocument.Tables(1).Cell(10, 4).Range = Sheets("数据").Cells(i, j + 17)
.ActiveDocument.Tables(1).Cell(11, 2).Range = Sheets("数据").Cells(i, j + 18)
.ActiveDocument.Tables(1).Cell(11, 4).Range = Sheets("数据").Cells(i, j + 19)
.ActiveDocument.Tables(1).Cell(12, 2).Range = Sheets("数据").Cells(i, j + 20)
.ActiveDocument.Tables(1).Cell(12, 4).Range = Sheets("数据").Cells(i, j + 21)
.ActiveDocument.Tables(1).Cell(13, 2).Range = Sheets("数据").Cells(i, j + 22)
.ActiveDocument.Tables(1).Cell(13, 4).Range = Sheets("数据").Cells(i, j + 23)
.ActiveDocument.Tables(1).Cell(2, 1).Range = Sheets("数据").Cells("1", j + 0)
.ActiveDocument.Tables(1).Cell(2, 3).Range = Sheets("数据").Cells("1", j + 1)
.ActiveDocument.Tables(1).Cell(3, 1).Range = Sheets("数据").Cells("1", j + 2)
.ActiveDocument.Tables(1).Cell(3, 3).Range = Sheets("数据").Cells("1", j + 3)
.ActiveDocument.Tables(1).Cell(4, 1).Range = Sheets("数据").Cells("1", j + 4)
.ActiveDocument.Tables(1).Cell(4, 3).Range = Sheets("数据").Cells("1", j + 5)
.ActiveDocument.Tables(1).Cell(5, 1).Range = Sheets("数据").Cells("1", j + 6)
.ActiveDocument.Tables(1).Cell(5, 3).Range = Sheets("数据").Cells("1", j + 7)
.ActiveDocument.Tables(1).Cell(6, 1).Range = Sheets("数据").Cells("1", j + 8)
.ActiveDocument.Tables(1).Cell(6, 3).Range = Sheets("数据").Cells("1", j + 9)
.ActiveDocument.Tables(1).Cell(7, 1).Range = Sheets("数据").Cells("1", j + 10)
.ActiveDocument.Tables(1).Cell(7, 3).Range = Sheets("数据").Cells("1", j + 11)
.ActiveDocument.Tables(1).Cell(8, 1).Range = Sheets("数据").Cells("1", j + 12)
.ActiveDocument.Tables(1).Cell(8, 3).Range = Sheets("数据").Cells("1", j + 13)
.ActiveDocument.Tables(1).Cell(9, 1).Range = Sheets("数据").Cells("1", j + 14)
.ActiveDocument.Tables(1).Cell(9, 3).Range = Sheets("数据").Cells("1", j + 15)
.ActiveDocument.Tables(1).Cell(10, 1).Range = Sheets("数据").Cells("1", j + 16)
.ActiveDocument.Tables(1).Cell(10, 3).Range = Sheets("数据").Cells("1", j + 17)
.ActiveDocument.Tables(1).Cell(11, 1).Range = Sheets("数据").Cells("1", j + 18)
.ActiveDocument.Tables(1).Cell(11, 3).Range = Sheets("数据").Cells("1", j + 19)
.ActiveDocument.Tables(1).Cell(12, 1).Range = Sheets("数据").Cells("1", j + 20)
.ActiveDocument.Tables(1).Cell(12, 3).Range = Sheets("数据").Cells("1", j + 21)
.ActiveDocument.Tables(1).Cell(13, 1).Range = Sheets("数据").Cells("1", j + 22)
.ActiveDocument.Tables(1).Cell(13, 3).Range = Sheets("数据").Cells("1", j + 23)
Next j |
|