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

¦p¦ó½Æ»s¤u§@­¶¨ì²Ä¤G­ÓÀÉ®×

¦p¦ó¸ò¾Ú¸ê®Æ¶×¥XÀÉ®×

½Ð°Ý¦U¦ì°ª¤â
¦p¦ó¸ò¾Ú¤U­±¸ê®Æ
±N¦³Ãö¤u§@ªí¥t¦s¦¨­Ó§OÀÉ®×,¨Ã¦s©ñ¦bc:\import ¤º, ¨Ò¦p:
ÀÉ®×AA ¥]¬A ¤u§@ªí sheet1, sheet2, sheet3, ¤Îbook1,book2 ¤ºªº©Ò¦³¤u§@ªí
ÀÉ®×BB ¥]¬A ¤u§@ªí sheet4, sheet5, sheet6, book3¤ºªº©Ò¦³¤u§@ªí

sheet1-sheet6 ¦b²{¦³¤u§@ªí¤º
book1- book3 ¦s©ñ¦bC:\export¤º

·sÀɮצW  ¤u§@ªí©ÎÀɮצWºÙ
AA        sheet1
AA        sheet2
AA        sheet3
AA        book1.xls
AA        book2.xls
BB        sheet4
BB        sheet5
BB        sheet6
BB        book3.xls
[attach]6844[/attach]

Book1.zip (1.97 KB)

TOP

½Ð°Ý¦³°ª¤â¥i¥HÀ°¨ì¦£¶Ü?

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-7-8 19:54 ½s¿è

¦^´_ 2# enoch
±N¦³Ãö¤u§@ªí¥t¦s¦¨­Ó§OÀÉ®×,¨Ã¦s©ñ¦bc:\import ¤º, ¨Ò¦p:
ÀÉ®×AA ¥]¬A ¤u§@ªí sheet1, sheet2, sheet3, ¤Îbook1,book2 ¤ºªº©Ò¦³¤u§@ªí
ÀÉ®×BB ¥]¬A ¤u§@ªí sheet4, sheet5, sheet6, book3¤ºªº©Ò¦³¤u§@ªí
sheet1, sheet2, sheet3,sheet4, sheet5, sheet6 ¬O¶}±Ò¤¤Àɮתº¤u§@ªí¶Ü?

TOP

GBKEE
sheet1, sheet2, sheet3,sheet4, sheet5, sheet6 ¥]¬A´£¨Ñ¸ê®Æªº¤u§@ªí
³£¬O¦b¶}±Ò¤¤ÀÉ®× summary.xls ªº¤u§@ªí¤º
¦Ó book2, ¤Î book3 ¬O¦s¦b©óc:\export\¤º¥¼¶}±ÒªºÀÉ®×
²{§Æ±æ¸ò¾Ú¸ê®Æ, ±N¤u§@ªí sheet1, sheet2, sheet3, ¤Î book1,book2 Àɮפºªº©Ò¦³¤u§@ªí
µ²¦X¦¨·sÀÉ®×AA.xls ¨Ã¦s©ó c:\test\
½ÐÀ°¦£

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-7-9 10:40 ½s¿è

¦^´_ 4# enoch
¸Õ¸Õ¬Ý
  1. Sub Ex()
  2.     Dim NewBook As Workbook
  3.     With Workbooks("summary.xls")
  4.         '''''''''''''''''''''''''''''''''''
  5.         Set NewBook = Workbooks.Open("c:\export\BOOK1.XLS")     '¶}±ÒBOOK1
  6.         With Workbooks.Open("c:\export\BOOK2.XLS")              '¶}±ÒBOOK2
  7.             .Sheets.Copy After:=NewBook.Sheets(NewBook.Sheets.Count) '¥þ³¡¤u§@ªí½Æ»s¨ì BOOK1ªº«á­±
  8.             .Close False                                        'Ãö³¬BOOK2 ¤£¦sÀÉ
  9.         End With
  10.         .Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Copy After:=NewBook.Sheets(NewBook.Sheets.Count)
  11.                                                                 '©Ò¿ïªº¤u§@ªí½Æ»s¨ì BOOK1ªº«á­±
  12.         NewBook.Close True, "c:\test\AA.XLS"                    'Ãö³¬BOOK1 ¦sÀɬ° "c:\test\AA.XLS"
  13.         ''''''''''''''''''''''''''''''''''''''''''
  14.         Set NewBook = Workbooks.Open("c:\export\BOOK3.XLS")     '¶}±ÒBOOK3
  15.         .Sheets(Array("Sheet4", "Sheet5", "Sheet6")).Copy After:=NewBook.Sheets(NewBook.Sheets.Count)
  16.                                                                 '©Ò¿ïªº¤u§@ªí½Æ»s¨ì BOOK3ªº«á­±
  17.         NewBook.Close True, "c:\test\BB.XLS"                    'Ãö³¬BOOK3 ¦sÀɬ° "c:\test\BB.XLS"
  18.     End With
  19. End Sub
½Æ»s¥N½X

TOP

¤£¦n·N«ä, »~·|¤F§Úªº°ÝÃD,
¨ä¹ê¥H¤W¥u¬O¨Ò¤l
ÀɮפΤu§@ªí¦WºÙ¤Î¸ê®Æ¦h¤Ö¨ä¹ê¤£·|©T©w

TOP

¦^´_ 6# enoch
¦p¦¹ªº¸Ü ¬°¦ó§A1¼ÓªºªþÀÉ¥u¦³¤T­Ó¤u§@ªí

TOP

¦p¦ó½Æ»s¤u§@­¶¨ì²Ä¤G­ÓÀÉ®×

§Ú·Q±N¤u§@­¶½Æ»s¨ì²Ä¤G­ÓÀɮתº³Ì«á­±,

   fileN = Cells(2, 1)
    sheetn = Cells(2, 2)
Sheets(sheetN).Copy before:=Workbooks(fileN).Sheets(1)

¦ýµ²ªG¥X²{¿ù»~, ³¯¦C¯Á¤Þ¶W¥X½d³ò, ½Ð°Ý¿ù¦b¦ó³B¤ÎÀ³¦p¦ó­×§ï
½Ð«ü±Ð

Sheets(sheetN).Copy before:=Workbooks(fileN).Sheets(1)

¬O½Æ»s¨ì²Ä¤G­Ó¤u§@諸³Ì«e­±
»y¥yÀ³¨S°ÝÃD¡A¤]³\¬O§A²Ä¤G­Ó¤u§@ï¨S¥´¶}¡C

TOP

Àˬd¹LÀɮצ³¶}±Ò,¤Îªþ¤W¾ã­Ó¥¨¶°¤º®e,
½Ð«ü±Ð¿ù¦b¦ó³B

Sub export()

    Sheets("export").Select
    Range("A1").Select
    fileN = Cells(2, 1)
    sheetn = Cells(2, 2)
     Workbooks.Add
   
ChDir "C:\"
ActiveWorkbook.SaveAs Filename:=fileN
ThisWorkbook.Activate

Sheets(sheetn).Select
Sheets(sheetn).Copy before:=Workbooks(fileN).Sheets(1)

End Sub

Book1.zip (8.2 KB)

TOP

        ÀR«ä¦Û¦b : ¤£­nÀH¤ß©Ò±ý¡A­nÀH¤ß±Ð¨|¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD