各位达人,近日我发现一段关于打工资条的宏代码,如下:
Sub 工资条()
'
' 工资条打印宏 Macro
' 记录的宏 2005-5-12
'
'
k = 2
For i = 2 To 6
j = i + k
Rows("2:1").Select
Selection.Copy
Rows(j).Select
Selection.Insert Shift:=xlDown
k = k + 2
Next
End Sub
k = 2
For i = 2 To 6 '你只要改6就行了.最后一条是多少就改为多少.
j = i + k
Rows("2:1").Select
Selection.Copy
Rows(j).Select
Selection.Insert Shift:=xlDown
k = k + 2
Next
End Sub
你的代码我没试,但我知道改6就行了.