 |
| 等 级:高级居民 |
| 经 验 值:1160 |
| 魅 力 值:187 |
| 龙 币:248 |
| 积 分:631.9 |
| 注册日期:2002-01-21 |
| |
|
|
|
用VBA试试
(作这些之前请存盘)
1。录制一个宏,名字叫:copyLine;
2。什么都不做,结束,保存;
3。按alt+f11进入vba编辑器,打开模块1;
4。吧下面的函数copy;
Sub copyLine()
Lines = 10 '此处设置你想要复制的数量
cols = 5 '此处设置你源表格的列数
rowStart = 2 '此处设置源表格的开始行号
rowHeigh = 2 '此处设置源表格的高度
rowBlank = 1 '此处设置表格之间的距离行数
For i = 1 To Lines
row = rowStart + i * (rowHeigh + rowBlank)
Sheet1.Range(Cells(row, 1), Cells(row + RowHeight, cols)).Borders.LineStyle = Sheet1.Range(Cells(rowStart, 1), Cells(rowStart + rowHeigh - 1, cols)).Borders.LineStyle
Sheet1.Range(Cells(row, 1), Cells(row + RowHeight, cols)).Font.Bold = Sheet1.Range(Cells(rowStart, 1), Cells(rowStart + rowHeigh - 1, cols)).Font.Bold
For j = 1 To cols
Sheet1.Cells(row, j) = Sheet1.Cells(rowStart, j)
Next j
row = row + 1
Sheet1.Range(Cells(row, 1), Cells(row + RowHeight, cols)).Borders.LineStyle = Sheet1.Range(Cells(rowStart, 1), Cells(rowStart + rowHeigh - 1, cols)).Borders.LineStyle
Next i
End Sub
5。调整相关的参数,按f5运行;
|
| |
|
|