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

[µo°Ý] ½Ð±ÐEXCEL¦X¨Ö

[µo°Ý] ½Ð±ÐEXCEL¦X¨Ö

½Ð°Ý°ª¤â¡A§ÚÁ`¦@¦³368­ÓXLSÀÉ¡A¨C­Ó³£¥u¦³¤@­ÓSHEET¡A¦ý§Ú­n368­ÓSHEET¦X¨Ö¨ì¤@­ÓÀÉ¡A¦³¨S¦³¤°»ò¤èªk?

¦^´_ 1# twcg
  1. Sub Ex()
  2.     Dim MergePath As String, FS As Object, MergeWorkbook As Workbook, E
  3.     MergePath = "D:\test\"  '¦X¨ÖÀɮתº¸ê®Æ§¨
  4.     Set FS = CreateObject("Scripting.FileSystemObject").GETFOLDER(MergePath).Files
  5.     'FS=¦X¨ÖÀɮ׸ê®Æ§¨¤¤©Ò¦³Àɮת«¥óªº¶°¦X
  6.     Set MergeWorkbook = Workbooks.Add(xlWBATWorksheet)  '·s¶}ªºÀÉ®×
  7.     Application.ScreenUpdating = False
  8.     For Each E In FS
  9.         If E Like "*.xls" Then  'ÀÉ®× ªº°ÆÀɦW¬°xls
  10.             With Workbooks.Open(E)
  11.                 .Sheets(1).Copy MergeWorkbook.Sheets(1)  '±N¤u§@ªí ½Æ»s¨ì·s¶}ªºÀɮפ¤
  12.                 .Close
  13.             End With
  14.         End If
  15.     Next
  16.     Application.DisplayAlerts = False
  17.     MergeWorkbook.SaveAs MergePath & "¦X¨Ö.XLS"  '¦X¨ÖÀɦsÀÉ
  18.     Application.DisplayAlerts = True
  19.     Application.ScreenUpdating = True
  20. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# GBKEE

    «Ü¦n¥Îªº¥\¯à, ½Ð°Ý¬O§_¥i¥H±N¤u§@ªí¦WºÙ«ö­ì¨Ó¤u§@ï¦WºÙ©R¦W?

TOP

¦^´_  GBKEE

    «Ü¦n¥Îªº¥\¯à, ½Ð°Ý¬O§_¥i¥H±N¤u§@ªí¦WºÙ«ö­ì¨Ó¤u§@ï¦WºÙ©R¦W?
ANGELA µoªí©ó 2010-10-5 10:50

With Workbooks.Open(E)
       .Sheets(1).Copy MergeWorkbook.Sheets(1)  '±N¤u§@ªí ½Æ»s¨ì·s¶}ªºÀɮפ¤
     MergeWorkbook.Sheets(1).Name = E.Name
       .Close
End With

TOP

¦^´_ 4# GBKEE


   ¥i¥H¤F, ÁÂÁª©¥D¦p¦¹¤@¨Ó´N¥i¥H§â´²¶ÃªºÀÉ®×ÂkÃþ¤F,°®²b¦h¤F.

TOP

¦^´_ 2# GBKEE


    ½Ð°Ý³o­n¥Î¤°»òµ{¦¡¥h°õ¦æ

TOP

¦^´_  GBKEE


    ½Ð°Ý³o­n¥Î¤°»òµ{¦¡¥h°õ¦æ
twcg µoªí©ó 2010-10-5 13:01

½Ð¥ý±Nµ{¦¡½Æ»s¨ìÀÉ®×VBA±M®×¸Ì ¥B­×§ïMergePath ¬°¦X¨ÖÀɮתº¸ê®Æ§¨¬°¥¿½Tªº¸ô®|
¤èªk¤@ ¦p¹Ï1



¤èªk¤G ¦p¹Ï2



¤èªk¤T ¦p¹Ï3    1.¶·±N·Æ¹«²¾°Ê¨ì«ü©wªºµ{¦¡½X  2.«öF5 °õ¦æ«ü©wªºµ{¦¡

TOP

Dear GBKEE
½Ð°Ý¬O§_¥i¥H±N¤u§@ªí¦WºÙ§ó§ï¬°¨ú­ì¨Ó¤u§@ïÀɮצWºÙ¤§²Ä5½X¦Ü²Ä10½X?
¨Ò¦p¡G
­ì¨Ó¤u§@ïÀɮצWºÙ¬° 2010ABCDE1PRINT.xls
¦X¨Ö«á¸Ó¤u§@ªí¦WºÙ¬° ABCDE1
·q½Ð«ü¾É
100 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 8# b9208
MergeWorkbook.Sheets(1).Name =Mid( E.Name, 5, 6)

TOP

Dear GBKEE
«D±`·PÁ«ü¾É¡Aµ{¦¡½X¥i¥H¨Ï¥Î¡C
100 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

        ÀR«ä¦Û¦b : ®É®É¦n¤ß´N¬O®É®É¦n¤é¡C
ªð¦^¦Cªí ¤W¤@¥DÃD