|
加个删除的你看行不行?
Sub Macro1()
'
' Macro1 Macro
' 宏由 xiaoyu 录制,时间: 2009-3-15
'
Call 删除
svname1 = Left([c2], WorksheetFunction.Find("月", [c2]) - 1) & "月"
svname2 = "工资数据删除"
Sheets("录入表").Copy Before:=Sheets(2)
ActiveSheet.Name = svname1
ActiveSheet.Shapes("Button 1").Select
Selection.Cut
Sheets("录入表").Copy Before:=Sheets(3)
ActiveSheet.Name = svname2
ActiveSheet.Shapes("Button 1").Select
Selection.Cut
Sheets("个人工资条").Select
ActiveWindow.SmallScroll Down:=-9
Cells.Select
Selection.Replace What:="#REF", Replacement:=svname2, _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:= _
False, ReplaceFormat:=False
Sheets("录入表").Select
ActiveWindow.SmallScroll Down:=-6
Range("E4:J19").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-24
Range("I7").Select
End Sub
Sub 删除()
Dim mysheet
For Each mysheet In Sheets
If mysheet.Name <> "个人工资条" And mysheet.Name <> "录入表" Then
mysheet.Delete
End If
Next
End Sub |
|