Skip to content

Instantly share code, notes, and snippets.

@fuchao2012
Created April 10, 2018 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fuchao2012/9a5a55b6abaf9c9c63568ba20f3e7917 to your computer and use it in GitHub Desktop.
Save fuchao2012/9a5a55b6abaf9c9c63568ba20f3e7917 to your computer and use it in GitHub Desktop.
制作工资条
Sub 制作工资条()
'
' 制作工资条
'
ActiveWindow.SmallScroll Down:=-3
'选择当前激活单元格所在的行
ActiveCell.Rows("1:1").EntireRow.Select
'复制选择项
Selection.Copy
'激活的单元格开始,移动(向下2,向右0),移动完成的单元格为当前激活单元格,并选中所在行
ActiveCell.Offset(2, 0).Rows("1:1").EntireRow.Select
'这一句就是将复制的内容粘贴,记住就就行了 Selection.Insert Shift:=xlDown
Selection.Insert Shift:=xlDown
'选中当前单元格并进入循环
ActiveCell.Select
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment