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

¦p¦ó©î¸Ñ­Ó¤HÁ~¸ê

¦p¦ó©î¸Ñ­Ó¤HÁ~¸ê

¦U¦ì¥ý¶i¤j®a¦n¡A
1.­ì¥»Á~¸ê³£¦b¦P¤@­ÓEXCEL¤u§@ªí¤¤¡A§Ú·Q­n¨Ì­Ó¤H¦W¦r©î¤À¦¨­Ó§OªºÀÉ®×
   ex : ±i¤T.xlsx    §õ¤é.xlsx   ¤ý¤­.xlsx ......

2.¦ý¬O§Ú¸I¨ìªº¬O¤@­Ó¤H­û´N¦³4¦Cªº¸ê°T


3.·Q½Ð±ÐVBA¸Ó¦p¦ó¼¶¼g(¤§«e¦³§ä¹Lºô¸ô¡A¥L¬O­Ó¤H¸ê°T¶È¤@¦C¡A©Ò¥H¥i¥H©î¡C¦ý§Úªº²{ªp¬O­Ó¤H¸ê°T¦³4¦C)
Á~¸êªí-01.rar (12.13 KB)

¦A½Ð¤j®aÀ°À°¦£¡C
Just do it.

  1. Sub save_out()
  2. Dim a As Range
  3. With ¤u§@ªí1
  4.    Set Rng = .Range("A3").Resize(2, 35)
  5.    For Each a In .Columns("A:A").SpecialCells(xlCellTypeConstants, 1)
  6.    f = a.Offset(, 1)
  7.    If f = "" Then GoTo 10
  8.    With Sheets.Add
  9.       Rng.Copy .[A3]
  10.       a.Resize(4, 35).Copy .[A5]
  11.       .Move
  12.      With ActiveWorkbook
  13.         .SaveAs "D:\" & f & ".xlsx"
  14.         .Close
  15.      End With
  16.     End With
  17. 10
  18.    Next
  19. End With
  20.      
  21. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 2# Hsieh
Hi Hsieh
·PÁ±zªº¦^ÂСA¦b°õ¦æVBA¹Lµ{¤¤¦³¥X²{¿ù»~°T®§¡A¬O§_¥i¥H±Ð®q¤@¤U¸Ó¦p¦ó³B²z©O?
ÁÂÁ±z!
Just do it.

TOP

¦^´_ 3# jsc0518

§Ú¬OWIN7-64 ¤Î OFFICE2007-32¡A­ì¨Ó°õ¦æ¤]¬O¦³°ÝÃD¡A«á¨Ó§ó·s¹q¸£¨t²Î«á´N¥i¥H¥¿±`°õ¦æ¤F¡C

§ó·sÀɮ׬° Microsoft .NET Framework 4.7
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 1# jsc0518
  1. Sub ¨C¤H¸ê®Æ¥t¦s·sÀÉ()
  2.     Dim xªíÀY°Ï As Range, x¸ê®Æ°Ï As Range
  3.     Dim xWB As Workbook, xWS As Worksheet

  4.     Set xWS = ThisWorkbook.Sheets("Sheet1")
  5.     Set xªíÀY°Ï = xWS.Range("A3:AI4")
  6.     Set x¸ê®Æ°Ï = xWS.Range("A5:AI8")

  7.     Application.DisplayAlerts = False '°±¤î¨t²ÎªºÄµ¥Ü - ¬O§_Âл\ÂÂÀÉ
  8.     Do While x¸ê®Æ°Ï(1, 1) <> ""
  9.         With Workbooks.Add
  10.             xªíÀY°Ï.Copy .Sheets(1).Range("A3")
  11.             x¸ê®Æ°Ï.Copy .Sheets(1).Range("A5")
  12.             .SaveAs "D:\" & x¸ê®Æ°Ï(1, 2) & ".xlsx"
  13.             .Close
  14.         End With
  15.         Set x¸ê®Æ°Ï = x¸ê®Æ°Ï.Offset(4)
  16.     Loop
  17.     Application.DisplayAlerts = True '«ì´_¨t²ÎªºÄµ¥Ü

  18. End Sub
½Æ»s¥N½X
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 5# ML089

¯uªº«Ü·PÁ§AªºÀ°¦£¡AÁÂÁ§Aªº¦^ÂСCÅý§Ú¸Ñ¨M¤F¤@¤j§xÂZ
Just do it.

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡µLªk¾B¾×¡j©È®É¶¡®ø³u¡Aªá¤F³\¦h¤ß¦å¡A·QºÉ¦U¦¡¤èªk­n¾B¾×®É¶¡¡Aµ²ªG¬O¡G®ö¶O¤F§ó¦h®É¶¡¡A¥B¤@µL©Ò¦¨¡I
ªð¦^¦Cªí ¤W¤@¥DÃD