ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¨D§U¡A¦p¦ó¥ÎVBA§â©î¤À¤u§@ªí¤Î¦sÀɤé´Á

[µo°Ý] ¨D§U¡A¦p¦ó¥ÎVBA§â©î¤À¤u§@ªí¤Î¦sÀɤé´Á

¤j®a¦n¡A

½Ð±Ð¤j®a¡A¨â­Ó°ÝÃD

¡]1¡^¤u§@Á¡¤¤¦³a b c d e f g¡A¦@7­Ósheet¡A§Ú¥u·Q©î¥Xc e g³o3­Ósheet¬°¿W¥ßªºÀɮסA¨ä¥L4­Ó¤£©î¤À¡C

¡]2¡^¦sÀɤé´Á¡A¦¨«ü©w¬°sheet g ¤¤¡AA1ªº¼Æ­È(A1=20120408)¡C

½Ð±Ð¤j®a¡A¸Ó¦p¦ó­×§ï¤U­±ªºVBA¡A¤~¯à¹ê²{§Ú·Q­nªº¥\¯à¡A·PÁ¤j®aÀ°¦£


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

¦^´_ 13# register313


    ·PÁÂregister313¤j¤j¡A¤w¸g¥i¥H¤F¡AÁÂÁ±z¡C;P

TOP

¬Ý¨ì¦U¦ì¥ý¶iªº¸Ô²Ó¸Ñµª,Åý¤p§Ì¨ü¯q¤£¤Ö,¯u¬O¤Ó·PÁ¤F^^

TOP

¦^´_ 12# threelin
  1. Sub ex()
  2. n = Sheets("g").[A1]
  3. sht = Array("c", "e", "g")
  4. ipath = ThisWorkbook.Path & "\"
  5. For Each sh In Sheets(sht)
  6. sh.Copy
  7. With ActiveWorkbook
  8. Cells.Copy
  9. Cells.PasteSpecial Paste:=xlPasteValues
  10. fs = ipath & n & sh.Name & ".xls"
  11. .SaveAs fs
  12. .Close
  13. End With
  14. Next
  15. End Sub
½Æ»s¥N½X

TOP

¦^´_ 11# register313

·PÁÂregister313 ªºÀ°¦£¡C:)

­è¤~¤Sµo²{¤@­Ó°ÝÃD¡Ac ¡Be ¡Bg¤T­Óªíªº¸ê®Æ¬O³sµ²¨ì¨ä¥¦ªí®æªº
©î¦¨¿W¥ßÀɮ׫á¡A¦bc ¡Be ¡Bg¡@¤T­Óªí¤¤¡AÀx¦s®æÁÙ¬O·|¦³³sµ²¸ô®|

½Ð±Ð±z
¸Ó¦p¦ó­×§ï¦¨¡A¥ý±Nc ¡Be ¡Bg¡@¤T­Óªí¤¤ªº¼Æ­È¿ï¾Ü©Ê¶K¤W«á¡A¦A©î¤À¦¨¤T­Ó¿W¥ßÀɮסAÁÂÁ±z¡C

TOP

¥»©«³Ì«á¥Ñ register313 ©ó 2012-4-23 13:12 ½s¿è

¦^´_ 10# threelin


fs = ipath & n & sh.Name &  ".xls"

TOP

¦^´_ 9# Hsieh


    ÁÂÁª©¥D±zªº¦^ÂСA§Ú©ú¥Õ¤F¡C

¡@½Ð±Ð±z¡A¦pªG¬O§â¤é´Á©ñ¦b«e­±¡A¬O¤£¬O¤£¥i¦æ¡AÁÙ¬O¦³¨ä¥¦ªº¼gªk¡H

TOP

¦^´_ 8# threelin
ipath=Thisworkbook.Path & "\"
ipath¬O¦sÀɦì¸m
¨Ò¦p:Thisworkbook¬O¦s©ñ¦bD:\TEMP
ipath´N¬O"D:\TEMP\"
­Yn="e"
n &  ipath´N¦¨¤F"eD:\TEMP\"

©Ò¥Hn &  ipath³o¼Ë¬O§ä¤£¨ì³o­Ó¸ê®Æ§¨¡A©Ò¥H¥X¿ù
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 6# Hsieh


    ·PÁª©¥D²Ó¤ß¤Î­@¤ßªº¦^µª¡A¥i¥H¥Î¤F¡AÁÂÁ±z¡C:)


    §Ú§â 08.fs = ipath & sh.Name & n & ".xls"   §ï¦¨ 08.fs = n & ipath & sh.Name &  ".xls"

    ¸õ¥X¿ù»~¡A¤£ª¾¹D¬O¬°¤°»ò¡H

TOP

¥»©«³Ì«á¥Ñ bbojj ©ó 2012-4-23 00:28 ½s¿è

·PÁª©¥D
¤S¦h¾Ç¤F¤@¨ÇªF¦è¡I

¦³­Ó°ÝÃD½Ð±Ð
³]©w ipath=ThisWorkBook.path ¬O­nÅý Copy¥X¨ÓªºÀÉ®×»P­ìÀɦb¦P¤@­Ó¸ê®Æ§¨©³¤U¶Ü¡H
ÁÂÁ¦^µª!

TOP

        ÀR«ä¦Û¦b : ¶¢¤HµL¼Ö½ì¡A¦£¤HµL¬O«D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD