|
楼主 |
发表于 2015-6-30 12:50
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub 生成有空白行的工资条()
'
' 生成有空白行的工资条
Sheets("工资表").Select
Range("A1:Z194").Select
Selection.Copy
Sheets("工资条").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A2").Select
Dim endrow As Integer
Dim i As Integer
endrow = Sheet1.Range("a65536").End(xlUp).Row - 1
For i = 4 To endrow
ActiveCell.Range("A1:Z2").Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.LargeScroll ToRight:=-1
ActiveCell.Offset(3, 0).Range("A1").Select
Selection.Insert Shift:=xlDown
Next i
End Sub |
|