ªð¦^¦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

¥»©«³Ì«á¥Ñ Hsieh ©ó 2012-4-22 23:33 ½s¿è

¦^´_ 1# threelin
ª½±µÂàĶ¦¨VBA
  1. Sub ex()
  2. sh = Array("c", "e", "g")
  3. ipath = ThisWorkbook.Path & "\"
  4. Sheets(sh).Copy
  5. With ActiveWorkbook
  6. .SaveAs ipath & Sheets("g").[A1] & ".xls"
  7. .Close
  8. End With
  9. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

[ª©¥DºÞ²z¯d¨¥]
  • Hsieh(2012-4-22 23:36): ¼Ó¤Wµ§»~¡A¤w§ó¥¿

¦^´_ 2# Hsieh


    ·PÁÂHsieh ª©¥D¡C

§Ú°õ¦æ«á¡A¥X²{¿ù»~ªº¤pµøµ¡¡Aµøµ¡ªº¥N¸¹400¡A½Ð±Ð±z¬O¤°»ò­ì¦]¡AÁÂÁ¡C

TOP

¦^´_ 3# threelin
  1. Sub ex()
  2. sh = Array("c", "e", "g")
  3. ipath = ThisWorkbook.Path & "\"
  4. Sheets(sh).Copy
  5. With ActiveWorkbook
  6. .SaveAs ipath & Sheets("g").[A1] & ".xls"
  7. .Close
  8. End With
  9. End Sub
½Æ»s¥N½X
­×¥¿2³B,¸Õ¸Õ¬Ý
¦A¦³°ÝÃD,­n´£¨ÑEXCELÀ£ÁYÀÉ

TOP

¦^´_ 2# Hsieh


    Hsieh ª©¥D

    ­è¤~ªº¿ù»~¡A§Úµo²{¬O§ÚA1ªº¼Æ­È¨S¥´©Ò³y¦¨ªº¡C

    §Ú¤S­«·s°õ¦æ¤F¤@¦¸¡A¦ý¤£¬O§Ú»Ý­nªºµ²ªG¡C

     §Ú·Q­nc¡Be¡Bg¤T­Ó¤u§@ªíÅܦ¨¤T­Ó¿W¥ßªºÀɮסA ÀɦW¤À§O¬° c 20120408.xls¡Be 20120408.xls¡B g 20120408.xls

     ¦A³Â·Ð±zÀ°¦£¡AÁÂÁ±z¡C

2012.rar (5.61 KB)

TOP

¦^´_ 5# 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. fs = ipath & sh.Name & n & ".xls"
  9. .SaveAs fs
  10. .Close
  11. End With
  12. Next
  13. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

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

¦^´_ 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

¦^´_ 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

¦^´_ 9# Hsieh


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

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

TOP

        ÀR«ä¦Û¦b : ¤Ñ¤W³Ì¬ü¬O¬P¬P¡A¤H¥Í³Ì¬ü¬O·Å±¡¡C
ªð¦^¦Cªí ¤W¤@¥DÃD