|
还是原来的问题,没有根本解决,从这里开始往后都要修改:
If Len(arr3(i, 1)) > 0 And Len(arr3(i, 2)) = 0 Then
Range(Cells(j + 3, (k - 1) * 5 + 1), Cells(j + 4, (k - 1) * 5 + 1)).Select
Selection.Merge
With Selection.Font
.Name = "微软雅黑" '这一行去掉,代码只能定义类别字体的大小,字体由模板来定义
.Size = 20
.Bold = True
End With
End If
If Len(arr3(i, 1)) > 0 And Len(arr3(i, 2)) = 0 And j > s - 3 Then
if k<3 then '这里只能解决部分问题,换页的时候仍然不行,需要重写
i=i+1
endif
Exit For
End If
...... '中间这部分不需要改动,代码省略
Next k
js = js + 1
Next i
改成:
If Len(arr3(i, 1)) > 0 And Len(arr3(i, 2)) = 0 Then
Range(Cells(j + 3, (k - 1) * 5 + 1), Cells(j + 4, (k - 1) * 5 + 1)).Select
Selection.Merge
With Selection.Font '这里去掉了字体重定义,字体由模板定义
.Size = 20
.Bold = True
End With
End If
i = i + 1 '这里有明显改动
If Len(arr3(i, 1)) > 0 And Len(arr3(i, 2)) = 0 And j > s - 3 Then
Exit For
End If
Next k
js = js + 1
i = i - 1 '这里增加了一行,丢失的那个类别就在这里产生的
Next i
|
|