Sub CopySht()
Dim ShtN$, Sht As Worksheet
ShtN = InputBox("請輸入工作表名稱")
If ShtN = "" Then Exit Sub
On Error Resume Next
Set Sht = Sheets(ShtN)
If Not Sht Is Nothing Then MsgBox "工作表名稱已存在!": Exit Sub
ActiveSheet.Copy after:=Sheets(2)
ActiveSheet.Name = ShtN
End Sub作者: chairles59 時間: 2016-4-19 21:17