(1)工作薄中有a b c d e f g,共7個sheet,我只想拆出c e g這3個sheet為獨立的檔案,其他4個不拆分。
(2)存檔日期,成指定為sheet g 中,A1的數值(A1=20120408)。
請教大家,該如何修改下面的VBA,才能實現我想要的功能,感謝大家幫忙
Sub test()
Dim sht As Worksheet, ipath As String, iname As String
ipath = ThisWorkbook.Path & "\"
Application.ScreenUpdating = False
For Each sht In ThisWorkbook.Worksheets
iname = sht.Name
sht.Copy
With ActiveWorkbook
.SaveAs Filename:=ipath & iname & " " & sht1.Range("a1") & ".xls"
.Close
End With
Next
Application.ScreenUpdating = True
End Sub作者: Hsieh 時間: 2012-4-22 22:51