|
发表于 2012-8-26 19:21
|
显示全部楼层
本楼为最佳答案
这样吗?录入按钮指定下面的宏- Sub 录入()
- Dim i As Long, j As Long
- Application.ScreenUpdating = False
- With Sheets("数据")
- i = .Range("a65536").End(xlUp).Row + 1
- .Rows(2).Copy
- .Rows(i).PasteSpecial xlPasteFormats
- Application.CutCopyMode = False
- For j = 2 To 8 Step 2
- .Cells(i, j / 2) = Cells(1, j)
- Cells(1, j) = ""
- Next
- For j = 1 To 3
- .Cells(i, 2 + 3 * j) = Cells(3, 2 * j + 1): Cells(3, 2 * j + 1) = ""
- .Cells(i, 3 + 3 * j) = Cells(3, 2 * j + 2): Cells(3, 2 * j + 2) = ""
- .Cells(i, 4 + 3 * j) = Cells(4, 2 * j + 1): Cells(4, 2 * j + 1) = ""
- Next
- End With
- Application.ScreenUpdating = True
- MsgBox "数据保存成功!"
- End Sub
复制代码 |
|