我是否知道是否有任何vba代码可以从以前的工作表(当前工作表之前的工作表)复制到活动工作表?
答案 0 :(得分:2)
试试这段代码:
Public Sub CpySheet()
Dim i As Long
Dim name As String
name = ActiveSheet.name
i = ActiveSheet.Index
Application.DisplayAlerts = False
Sheets(i).Delete
Application.DisplayAlerts = True
Worksheets(i - 1).Copy after:=Worksheets(i - 1)
Sheets(i).name = name
End Sub