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

[µo°Ý] ±N¸ê®Æ¼g¤J¨ì¨ä¥L¦h­ÓEXCELÀÉ®×

¦^´_ 12# lpk187
§Ú±N¸ê®Æ¾ã²z¦n¤F

¨C¤é§ó·s±µ¦¬¡A¶À¦â°Ï¶ô¦³sub ­pºâ¼Æ¶q¡A©Ò¥H§Æ±ævba¶K¹L¥h¤£·|Âл\¡A©ÎªÌ¦³¤°»ò¤èªk¥i¥H¸Ñ¨M¤]¥i¥H¡A
¦]¬°¶Ç°e¹L¥hªº¸ê®Æ¡A¦³¥i¯à·|°µ·L½Õ¡A©Ò¥H¤~§Æ±æ¨ç¼Æ¤£­n³QÂл\±¼¡C
¦@·|¶Ç°e3µ§¸ê®Æ¨ì¦U­Ó¤£¦Pªº¤u§@ªí¡C
VBA¸ê®Æ¦Û°Ê¶Ç°e°ÝÃD.rar (302.42 KB)

TOP

¦^´_ 12# lpk187


    ¦n!§Ú¥þ³¡¾ã²z¤@¤U¦A¸ò§A»¡¡AÁÂÁÂ

TOP

¦^´_ 11# mark761222

¥i¥Hªº¸Ü¡A½Ðªþ¤W§Aªº½d¨ÒÀɮפW¨Ó¡A¦Ó¥B¬O§A³Ì²×¥Øªºªº½d¨ÒÀÉ¡A¥Øªº¤£¦P¡A´Nºâ¥u¦³¨Ç³\ªº§ïÅÜ¡A¥i¯àµ{¦¡³£­n¤j´Tªº§ïÅÜ¡A´N¹³11¼Óªº°ÝÃD¡A©M¤§«eªº¼gªk¤j³¡¥÷·|¤£¤@¼Ë¡I
¬Æ¦Ü¥i¥Hªº¸Ü¦b½d¨ÒÀɤ¤½Ðªþ¤WCÄæ¤ÎFÄ檺¤½¦¡¡I

TOP

¦^´_ 9# lpk187
§Ú¸Õ¹L¤F!¥i¥H¦ý¦³¤@­Ó¦a¤è·|¿ù»~¡A²Ä¤@¦¸¸ê®ÆÂà¥X¥i¥H¡A¦A«ö²Ä¤G¦¸¥L·|¥X²{¤U¹Ï
AAA.jpg
  1. Sub Workbook_Open2()
  2. Dim xlPath As Variant, Ro As Integer
  3. Dim xlFilea, xlFileb, arra, arrb
  4.     xlPath = ThisWorkbook.Path & "\"
  5. xlFilea = ("B.xlsx")
  6. xlFileb = ("C.xlsx")
  7. arra = Sheets("¤u§@ªí1").Range("A1:F1")
  8. arrb = Sheets("¤u§@ªí1").Range("A2:F2")
  9.     Workbooks.Open (xlPath & xlFilea)
  10.     With Workbooks(xlFilea).Worksheets("¤u§@ªí1")
  11.         Set da = .Columns(1).Find(arra(1, 1), , , , , 2)
  12.         If Not da Is Nothing Then GoTo 10
  13.          Ro = .Cells(65535, 1).End(xlUp).Row + 1
  14.          
  15.         .Cells(Ro, 1).Resize(UBound(arra), UBound(arra, 2)) = arra
  16.     End With
  17. 10:
  18.     Workbooks(xlFilea).Close True

  19.     Workbooks.Open (xlPath & xlFileb)
  20.     With Workbooks(xlFileb).Worksheets("¤u§@ªí1")
  21.         Set da = .Columns(1).Find(arrb(1, 1), , , , , 2)
  22.         If Not da Is Nothing Then GoTo 10
  23.         Ro = .Cells(65535, 1).End(xlUp).Row + 1
  24.         .Cells(Ro, 1).Resize(UBound(arrb), UBound(arrb, 2)) = arrb
  25.     End With
  26. 20:
  27.     Workbooks(xlFileb).Close True

  28. End Sub
½Æ»s¥N½X
¥t¤@¤è­±¦pªG¶Ç°e¤è¦¡Åܦ¨¦p¤U¹Ï
c.xlsx·|¦³¨ç¼Æ¥h­pºâ¼Æ­È¡A¥i¥H¸õ®æ¶Ç°e¶Ü

TOP

¤Ô¹Ø!¶V¨Ó¶V½ÆÂø¡A³£§Ö¬Ý¤£À´¤F= =
¥i¥HÀ°¦£µù¸Ñ¤@¤U¶Ü@@

TOP

¦^´_ 8# mark761222

¸Õ¸Õ¬Ý
  1. Private Sub Workbook_Open()
  2. Dim xlPath As Variant, Ro As Integer
  3. Dim xlFilea, xlFileb, arra, arrb
  4.     xlPath = ThisWorkbook.Path & "\"
  5. xlFilea = ("B.xlsx")
  6. xlFileb = ("C.xlsx")
  7. arra = Sheets("¤u§@ªí1").Range("A1:E1")
  8. arrb = Sheets("¤u§@ªí1").Range("A2:E2")
  9.     Workbooks.Open (xlPath & xlFilea)
  10.     With Workbooks(xlFilea).Worksheets("¤u§@ªí1")
  11.         Set da = .Columns(1).Find(arra(1, 1), , , , , 2)
  12.         If Not da Is Nothing Then GoTo 10
  13.          Ro = .Cells(65535, 1).End(xlUp).Row + 1
  14.          
  15.         .Cells(Ro, 1) = arra
  16.     End With
  17. 10:
  18.     Workbooks(xlFilea).Close True

  19.     Workbooks.Open (xlPath & xlFileb)
  20.     With Workbooks(xlFileb).Worksheets("¤u§@ªí1")
  21.         Set da = .Columns(1).Find(arra(1, 1), , , , , 2)
  22.         If Not da Is Nothing Then GoTo 10
  23.         Ro = .Cells(65535, 1).End(xlUp).Row + 1
  24.         .Cells(Ro, 1) = arrb
  25.     End With
  26. 20:
  27.     Workbooks(xlFileb).Close True

  28. End Sub
½Æ»s¥N½X

TOP

¦^´_ 7# lpk187

ÁÂÁÂ!¯uªº¥i¥H¤F¡A¦pªG­n¥[¤WÅçÃÒ¾÷¨îÀ³¸Ó«ÜÃø§a
¨Ò¦pA 2015/11/6¥h°»´úB 2015/11/6 »PC 2015/11/6  ¦pªG¦³³o­Ó¤é´Á¤£·s¼W¡A¦³ªº¸Ü·s¼W

ÁÂÁ§Aªº«ü¾É!

TOP

¦^´_ 6# mark761222


   ¤é´ÁÁÙ­«½Æ2¦¸¬O§A¦h¼g¤F For i = 0 To 1 ¡A§â2­ÓFor i = 0 To 1...Next§R¤F§a¡I
­P©ó¬°¤°»ò¥u¶Ç°e¤é´Á¡A¤º®e¤£·|¶Ç°e
«h¬O.Cells(Ro, 1) = arra ¿ù»~¡A§AÀ³¸Ó­n¦h¥[Resize½d³òµ¹¥¦
.Cells(Ro, 1).Resize(Ubound(arra),Ubound(arra,2)) = arra
.Cells(Ro, 1) = arrb ¥ç¦P¤W

TOP

TO lpk187
¤S¹J¨ì°ÝÃD¤F¡Aµy·L§ï¤F¤@¤Uµ{¦¡
°²³]A ¤u§@ªí¦³2µ§¸ê®Æ A1:E1 ­n°e¸ê®Æ¨ìB
A2:E2­n°e¸ê®ÆC
§ï¤F¥H¤Uµ{¦¡¡A¦ý¬O¥u¶Ç°e¤é´Á¡A¤º®e¤£·|¶Ç°e¡A¦Ó¥B¤é´ÁÁÙ­«½Æ2¦¸¡A¬O­þ¸Ì²z¸Ñ¿ù»~¤F¶Ü

¤£¦n·N«ä¤@­È³Â·Ð§A
  1. Private Sub Workbook_Open()
  2. Dim xlPath As Variant, Ro As Integer
  3. Dim xlFilea, xlFileb, arra, arrb
  4.     xlPath = ThisWorkbook.Path & "\"
  5. xlFilea = ("B.xlsx")
  6. xlFileb = ("C.xlsx")
  7. arra = Sheets("¤u§@ªí1").Range("A1:E1")
  8. arrb = Sheets("¤u§@ªí1").Range("A2:E2")

  9. For i = 0 To 1
  10.     Workbooks.Open (xlPath & xlFilea)
  11.     With Workbooks(xlFilea).Worksheets("¤u§@ªí1")
  12.          Ro = .Cells(65535, 1).End(xlUp).Row + 1
  13.         .Cells(Ro, 1) = arra
  14.     End With
  15.     Workbooks(xlFilea).Close True
  16. Next
  17. For i = 0 To 1
  18.     Workbooks.Open (xlPath & xlFileb)
  19.     With Workbooks(xlFileb).Worksheets("¤u§@ªí1")
  20.          Ro = .Cells(65535, 1).End(xlUp).Row + 1
  21.          .Cells(Ro, 1) = arrb
  22.     End With
  23.     Workbooks(xlFileb).Close True
  24. Next

  25. End Sub
½Æ»s¥N½X

TOP

¦^´_ 1# mark761222

½Ð°Ñ¦Ò
http://minyeh187.pixnet.net/blog/post/166816531

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡¦¨´N¤@¤Á¡j®É¶¡¥i¥H³y´N¤H®æ¡A¥i¥H¦¨´N¨Æ·~¡A¤]¥i¥HÀx¿n¥\¼w¡C
ªð¦^¦Cªí ¤W¤@¥DÃD