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

[µo°Ý] ±N¸ê®Æ¦Û°Ê½Æ»s¨ì¡A¥Ø«eÂI¿ïªº©Ò¦b­¶­±¨Ã¦Û°Ê¿ï¾Ü³Ì«á¤@¦æªÅ¥Õ³B¶K¤W

¦^´_ 14# starry1314

¤£«ü©wWorkbooks¥Nªí¨Ï¥Î¥Ø«eªº¬¡­¶Ã¯

    Sheets("«È¤á©ú²Ó").Rows(2).Copy'¥Nªí¥Ø«e¨Ï¥Î¬¡­¶Ã¯ªº"«È¤á©ú²Ó"¤À­¶ªº²Ä¤G¦C¶i¦æ½Æ»s
    EndRow = ActiveSheet.UsedRange.Rows.Count + 1 '©Ò¦³¨Ï¥Î¤¤ªº¦C¼Æ+1
    Rows(EndRow).PasteSpecial Paste:=xlPasteValues'¥Ø«e¨Ï¥Î¤¤ªº¤À­¶,ªº³Ì¤U¤èªÅ¥Õ¦C¶K¤W­È
PKKO

TOP

¦^´_ 21# PKKO


   ·PÁ»¡©ú¡ã¥t¥~¦³­Ó·Qªk
§Ú¼g¦¨¤@­ÓÀɮ׬O©T©wÀɦWªº¦n¤F¡A
¨Ò¦p³o¼Ë
©T©w¡]·~°È±M¥Î¢ë¡Ð«È¤á©ú²Ó¡^¡@¡@¡@¡@¤£©T©w¡]«È¤á¸ê®Æ¡^¡@¡@Åý©T©w¡]·~°È±M¥Î¢ë¡Ð«È¤á©ú²Ó¡^¥i¥H¥h¦Û¤v§ì¨ú¤£©T©w¡]«È¤á¸ê®Æ¡^¤ºªº²Ä¤G­Ó¤À­¶²Ä¢±¦æ¡A·|¨Ó¶K¦b©T©w¡]·~°È±M¥Î¢ë¡Ð«È¤á©ú²Ó¡^ªÅ¥Õ¸ê®Æªº³Ì«á¤@¦æ
©T©w¡]·~°È±M¥Î¢ê¡Ð«È¤á©ú²Ó¡^¡@¡@¡@¡@¤£©T©w¡]«È¤á¸ê®Æ¡^
©T©w¡]·~°È±M¥Î¢é¡Ð«È¤á©ú²Ó¡^¡@¡@¡@¡@¤£©T©w¡]«È¤á¸ê®Æ¡^

TOP

·Q­É´£°Ý©T©wÀÉ®×ÀɦWªº¤À­¶¸ê®Æ½Æ»s°ÝÃD
·Q±q¸ê®Æªí"·í¤ë³øªí"¤¤«Ø¥ß¥¨¶°¡A§@¥Î¦p ¤U
½Æ»s"·í¤ë³øªí"¤¤ªº[ºî¦X¸ê®Æ®w]ªºA5:AQ¦³­Èªº³Ì«á¤@¦æ
¨ì
"¥þ¦~«×¸ê®Æ®w"¸ê®Æªíªº[ºî¦X¸ê®Æ®w]¤¤ªºA¦C¦³­Èªº¤U¤@¦æ(ªÅ¥Õ³B)

·Q¸ß°Ý«e½ú­Ì¡A¥H¤W¥¨¶°­n¦p¦ó½s¼g¤ñ¸û¥¿½T
¦pªG¨S¦³¥´¶}ÀÉ®×"¥þ¦~«×¸ê®Æ®w"¡A½Ð°Ý·|¦Û°Ê¥´¶}¶Ü?

TOP

·Q­É´£°Ý©T©wÀÉ®×ÀɦWªº¤À­¶¸ê®Æ½Æ»s°ÝÃD
·Q±q¸ê®Æªí"·í¤ë³øªí"¤¤«Ø¥ß¥¨¶°¡A§@¥Î¦p ¤U
½Æ»s"·í¤ë³øªí"¤¤ªº ...
jackson7015 µoªí©ó 2015-5-7 08:29
  1. Sub nn()
  2.   Dim lSRow&, lTRow&
  3.   Dim sPath$
  4.   Dim bNFind As Boolean
  5.   Dim wsSou As Worksheet, wsTar As Worksheet
  6.   Dim wbSou As Workbook, wbTar As Workbook
  7.   
  8. sPath = ThisWorkbook.Path
  9. ChDrive sPath
  10. ChDir sPath
  11.   Set wbSou = ThisWorkbook
  12.   Set wsSou = wbSou.Sheets("ºî¦X¸ê®Æ®w")
  13.   
  14.   bNFind = True
  15.   For Each wbTar In Workbooks ' ¥þ¦~«×¸ê®Æ®w Àɮ׬O§_¤w¶}±Ò
  16.     If wbTar.Name = "¥þ¦~«×¸ê®Æ®w.xls" Then
  17.       Set wsTar = wbTar.Sheets("ºî¦X¸ê®Æ®w")
  18.       bNFind = False
  19.       Exit For
  20.     End If
  21.   Next
  22.   If bNFind Then ' ­YÀÉ®×¥¼¶}±Ò«h¶}±Ò¥¦
  23.     With Workbooks.Open("¥þ¦~«×¸ê®Æ®w.xls", , True)
  24.       Set wbTar = ThisWorkbook
  25.       Set wsTar = .Sheets("ºî¦X¸ê®Æ®w")
  26.     End With
  27.   End If
  28.   
  29.   With wsSou
  30.     lSRow = .Cells(Rows.Count, [AQ1].Column).End(xlUp).Row ' §ä¥½¦C
  31.     lTRow = wsTar.Cells(Rows.Count, 1).End(xlUp).Row
  32.     .Range([A5], .Cells(lSRow, [AQ1].Column)).Copy wsTar.Cells(lTRow, 1)
  33.   End With
  34. End Sub
½Æ»s¥N½X
¦³¨Ç«ü¥O¨ÃµL¥²­n©Ê,
¥u¬O¤@¨Ö¦C¥X¨Ó¬ÛÃöª«¥ó¥i¥H¥Î«ç¼Ëªº«ü¥O¨Ó¨ú±o.

­Y¦³¥ý°õ¦æ©³¤U³o¤T¦æ,
sPath = ThisWorkbook.Path
ChDrive sPath
ChDir sPath
«h¥u»Ý­n±NÀɮ׳£©ñ¦b¦P­Ó¥Ø¿ý¤U,
ŪÀÉ«ü¥O¤¤¥i¥H¤£¥Î¦Aµ¹¸ô®|.

TOP

¦^´_ 24# luhpro

·PÁÂluhpro¤j¤jªº¦^ÂÐ

¥¨¶°¥d¦b
  1. lSRow = .Cells(Rows.Count, [AQ1].Column).End(xlUp).Row ' §ä¥½¦C
½Æ»s¥N½X
¥´¶}ªº¥þ¦~«×¸ê®Æ®wµL»~
½Ð°Ý¸Ó¦p¦ó±Æ¸Ñ?

TOP

¦^´_ 25# jackson7015
¬O³o¼Ë¶Ü?
  1. lSRow = .Cells(.Rows.Count, .[AQ1].Column).End(xlUp).Row ' §ä¥½¦C
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ jackson7015 ©ó 2015-5-12 16:17 ½s¿è

¦^´_ 26# GBKEE

·PÁÂGBKEEªO¤j
­ìª¬ªp±Æ°£¤F

¦ý¬O¤S¥X¤F·sª¬ªp...
§Úªº¦]¬°A4:AQ4³£¦³­È¡A©Ò¥H§Ú§â[CTRL+¡õ]ªº«ü¥O§ï¦¨±qAQ4¶}©l(End(xlUp)ªº·N«äÀ³¸Ó¬O³o¼Ë¨S¿ù§a?)
¦ý¬OÁÙ¥X²{°ÝÃD
  1.     lTRow = wsTar.Cells(Rows.Count, 1).End(xlUp).Row
  2.     .Range([A5], .Cells(lSRow, [AQ4].Column)).Copy wsTar.Cells(lTRow, 1)
½Æ»s¥N½X
¤U­±ªº¦C¦¡¦³¿ù»~
  1.     .Range([A5], .Cells(lSRow, [AQ4].Column)).Copy wsTar.Cells(lTRow, 1)
½Æ»s¥N½X
¦A½Ð«e½ú­Ì¤ÀªR¬Ý¬Ý
·PÁÂ~

TOP

¦^´_ 27# jackson7015
¸Õ¸Õ¬Ý
  1. With wsTar
  2.         lTRow = .Cells(.Rows.Count, 1).End(xlUp).Row
  3.         .Range(.[A5], .Cells(lSRow, .[AQ4].Column)).Copy .Cells(lTRow, 1)
  4.     End With
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 28# GBKEE

¥ý·PÁÂGBKEEªO¥Dªº¦^ÂÐ
¿ù»~°T®§¥Ø«e³£±Æ°£¤F
¦ý¬O«o¥X²{¨S¦³½Æ»s"·í¤ë³øªí"¤¤ªº[ºî¦X¸ê®Æ®w]¨ì
"¥þ¦~«×¸ê®Æ®w"¸ê®Æªíªº[ºî¦X¸ê®Æ®w]¤¤

¤Ï¦Ó¥X²{
¶}±Ò"¥þ¦~«×¸ê®Æ®w"¸ê®Æªíªº[ºî¦X¸ê®Æ®w]¤¤½Æ»s¤Fa1:aq¦³­Èªº³Ì«á¤@¦æ
¨ì
"¥þ¦~«×¸ê®Æ®w"¸ê®Æªíªº[ºî¦X¸ê®Æ®w]ªºªÅ¥Õ³B¤U¤è¥h¤F

¬O§_¥i¥H¦A½ÐÀ°¦£¬Ý¬Ý­þ¸Ì¦³°ÝÃD©O..
  1. Sub nn()
  2.   Dim lSRow&, lTRow&
  3.   Dim sPath$
  4.   Dim bNFind As Boolean
  5.   Dim wsSou As Worksheet, wsTar As Worksheet
  6.   Dim wbSou As Workbook, wbTar As Workbook
  7.   
  8. sPath = ThisWorkbook.Path
  9. ChDrive sPath
  10. ChDir sPath
  11.   Set wbSou = ThisWorkbook
  12.   Set wsSou = wbSou.Sheets("ºî¦X¸ê®Æ®w")
  13.   
  14.   bNFind = True
  15.   For Each wbTar In Workbooks ' ¥þ¦~«×¸ê®Æ®w Àɮ׬O§_¤w¶}±Ò
  16.     If wbTar.Name = "¥þ¦~«×¸ê®Æ®w.xlsm" Then
  17.       Set wsTar = wbTar.Sheets("ºî¦X¸ê®Æ®w")
  18.       bNFind = False
  19.       Exit For
  20.     End If
  21.   Next
  22.   If bNFind Then ' ­YÀÉ®×¥¼¶}±Ò«h¶}±Ò¥¦
  23.     With Workbooks.Open("¥þ¦~«×¸ê®Æ®w.xlsm", , True)
  24.       Set wbTar = ThisWorkbook
  25.       Set wsTar = .Sheets("ºî¦X¸ê®Æ®w")
  26.     End With
  27.   End If
  28.   
  29.   With wsTar
  30.     lSRow = .Cells(.Rows.Count, .[AQ1].Column).End(xlUp).Row ' §ä¥½¦C
  31.     lTRow = .Cells(.Rows.Count, 1).End(xlUp).Row
  32.     .Range(.[A5], .Cells(lSRow, .[AQ4].Column)).Copy .Cells(lTRow, 1)
  33.   End With
  34. End Sub
½Æ»s¥N½X

TOP

¦^´_ 29# jackson7015
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim E As Variant, wbSh(1 To 2) As Worksheet, bNFind(1 To 2) As Boolean
  4.     Dim AR(1 To 2), xPath As String, Rng As Range
  5.     AR(1) = "¥þ¦~«×¸ê®Æ®w.xls"        'ÀɮצWºÙ
  6.     AR(2) = "·í¤ë³øªí.xls"            'ÀɮצWºÙ
  7.     xPath = "D:\"                     'Àɮתº¸ô®|
  8.     For Each E In Workbooks           '©Ò¦³¶}±Òªº¬¡­¶Ã¯ª«¥ó¶°¦X
  9.         If E.Name = AR(1) Then bNFind(1) = True  '¥þ¦~«×¸ê®Æ®w ¤w¶}±Ò
  10.         If E.Name = AR(2) Then bNFind(2) = True  '·í¤ë³øªí ¤w¶}±Ò
  11.     Next
  12.     For E = 1 To UBound(bNFind)
  13.         If Not bNFind(E) Then              'ÀÉ®×¥¼¶}±Ò
  14.             Workbooks.Open (xPath & AR(E))
  15.         End If
  16.         Set wbSh(E) = Workbooks(AR(E)).Sheets("ºî¦X¸ê®Æ®w")
  17.     Next
  18.     With wbSh(2) '·í¤ë³øªí"¤¤ªº[ºî¦X¸ê®Æ®w]
  19.         Set Rng = .Cells(.Rows.Count, .[AQ1].Column).End(xlUp) ' §ä¥½¦C
  20.         Set Rng = .Range(.[A5], Rng)
  21.     End With
  22.     With wbSh(1) '¥þ¦~«×¸ê®Æ®w"¸ê®Æªíªº[ºî¦X¸ê®Æ®w]
  23.         Rng.Copy .Cells(.Rows.Count, 1).End(xlUp).Offset(1)
  24.     End With
  25.     For Each E In AR
  26.         Workbooks(E).Close True   '¥þ¦~«×¸ê®Æ®w,·í¤ë³øªí. Ãö³¬¥B¦sÀÉ
  27.     Next
  28. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¬°¦Û¤v§äÂǤfªº¤H¥Ã»·¤£·|¶i¨B¡C
ªð¦^¦Cªí ¤W¤@¥DÃD