我使用下面的代码合并单元格,但我不知道如何修改它,如你所建议的那样
Sub mergecells()
Dim lcol as long, lrow as long
With sheets("employee data")
For lrow = 4 to 1000 step 6
For lcol = 1 to 33
.Range(.cells(Row, lcol),.cells(lrow +5, lcol)).merge
Next lcol
For lcol= 42 to 45
.Range(.cells(Row, lcol),.cells(lrow +5, lcol)).merge
Next lcol
For lcol= 49 to 55
.Range(.cells(Row, lcol),.cells(lrow +5, lcol)).merge
Next lcol
Next lrow
End with
End sub