- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# twcg - Sub Ex()
- Dim MergePath As String, FS As Object, MergeWorkbook As Workbook, E
- MergePath = "D:\test\" '¦X¨ÖÀɮתº¸ê®Æ§¨
- Set FS = CreateObject("Scripting.FileSystemObject").GETFOLDER(MergePath).Files
- 'FS=¦X¨ÖÀɮ׸ê®Æ§¨¤¤©Ò¦³Àɮת«¥óªº¶°¦X
- Set MergeWorkbook = Workbooks.Add(xlWBATWorksheet) '·s¶}ªºÀÉ®×
- Application.ScreenUpdating = False
- For Each E In FS
- If E Like "*.xls" Then 'ÀÉ®× ªº°ÆÀɦW¬°xls
- With Workbooks.Open(E)
- .Sheets(1).Copy MergeWorkbook.Sheets(1) '±N¤u§@ªí ½Æ»s¨ì·s¶}ªºÀɮפ¤
- .Close
- End With
- End If
- Next
- Application.DisplayAlerts = False
- MergeWorkbook.SaveAs MergePath & "¦X¨Ö.XLS" '¦X¨ÖÀɦsÀÉ
- Application.DisplayAlerts = True
- Application.ScreenUpdating = True
- End Sub
½Æ»s¥N½X |
|