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

COPY¤u§@­¶¤ÎÀˬdÀx¦s®æ¤º®e

COPY¤u§@­¶¤ÎÀˬdÀx¦s®æ¤º®e

½Ð°Ý­YªG·Q±NBOOK1.XLS ¤ºªº©Ò¦³sheets COPY ¨ì BOOK2.XLS¤º
¤Î ÀˬdÀx¦s®æA1 ªº¤º®e¥Ñ¥k¦V¥ª¼Æ¬O§_µ¥©ó"ABC"  
À³¸Ó¦p¦ó¼g©O, ½Ð«ü±Ð

§Ú¤â¤W¦³¤@­Ó¤§«e¼gªº¥¨¶°:
±N¦P¤@¥Ø¿ý§¨¤Uªº¦UÀÉ®×(¥i¦h­Óworksheet)¡A¶×¾ã¦b¦P¤@­Ó¤u§@Àɮפ¤
½Ð°Ñ¦Ò¬Ý¬Ý ±N¦P¤@¥Ø¿ý§¨¤Uªº¦UÀɮצh­Óworksheet¶×¾ã¦b¦P¤@­Ó¤u§@Àɮפ¤.rar (21.1 KB)

TOP

§Ú¨S¦³Åv­­¤U¸ü

TOP

§âcode¶K¦b¤U­±:

Sub Exx()
'¦X¨Ö¦P¤@¸ê®Æ§¨¤º©Ò¦³ExcelÀɤ§Sheet¤u§@ªí
Dim NewName As String
Dim MyBook As Workbook
Dim MyFile$, i%, k%

MyFile = Dir(ThisWorkbook.Path & "\*.xls")
Set MyBook = ThisWorkbook

i = 1
Application.ScreenUpdating = False
Do While MyFile <> ""
  If MyFile <> MyBook.Name Then  
     With Workbooks.Open(ThisWorkbook.Path & "\" & MyFile)     
     For k = 1 To Sheets.Count
        Sheets(k).Select
        ActiveSheet.Range("a1").Select
        NewName = Left(MyFile, Len(MyFile) - 4)
        ActiveSheet.Copy After:=MyBook.Sheets(MyBook.Sheets.Count)
        ActiveSheet.Name = NewName & "_" & k     
     Next k
     k = 1
     Application.DisplayAlerts = False
     .Close
       On Error Resume Next     
     End With
  End If
  MyFile = Dir
Loop
Application.ScreenUpdating = True
End Sub

TOP

¦hÁ«ü±Ð, §Ú·|ºCºC®ø¤Æ

TOP

¥ý«Ø¤@­Ó¿W¥ßªº¥Ø¿ý§¨
¦b¥Ø¿ý§¨¤U¥ô«Ø¤@­ÓÀÉ(ÀɦW¤£©ë,°²³]¬°abc.xls) «ö alt+F11
±N¤W­±ªºµ{¦¡½X½Æ»s¦b¼Ò²Õ¤º ¦sÀÉ

±N±ý¦¬¶°ªº¦h­ÓÀÉ©ñ¦b¦¹¥Ø¿ý§¨¤U
¦A¥´¶}abc.xls ¶]Exx³o­Ó¥¨¶°§Y¥i

TOP

¦^´_ 1# enoch


    µo²{¤§«eªºµ{¦¡¥u·|½Æ»s²Ä¤@­Ó¤u§@ªí¡A¤@ª½©ñµÛ¨S¨Ó³o¸Ì­×¥¿¡A½Ð®ü²[¡C¤§«á¦³ª¦¤å¨ú±oªº¶i¤@¨Bªº­×¥¿¦p¤U¡G
¡@¡@§@ªÌ¡Gª¾¥G¥Î¤á¡@³sµ²¡Ghttps://www.zhihu.com/question/20366713/answer/50817274¡@¨Ó·½¡Gª¾¥G

¡@¡@§ïª©«áªºµ{¦¡¦pªþ¥ó¡A°õ¦æ«áªºµ²ªG´N¬O§Ú·Q­nªº¡C
¡@¡@ Revised.zip (47.41 KB)

TOP

        ÀR«ä¦Û¦b : ÀR§¤±`®¦¤v¹L¡B¶¢½Í²ö½×¤H«D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD