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

Ãö©ó¸ê®Æ¤ñ¹ï

Ãö©ó¸ê®Æ¤ñ¹ï

§Ú¥Hfor next Âù°j°é¤Îif§PÂ_¤ñ¹ï¤G­Ósheets¼t°Ó¥N¸¹»P³fª«¥N¸¹
ªº¸ê®Æ«á¡A­Y¤GÄæ¸ê®Æ¬Û²ÅªÌ¡A§Ú¤£³B²z¡A­Y¤£²ÅªÌ¡A±Nsheet1ªº¸ÓÄæ¦ì¸ê®Æ¦^¼g¦bsheet3¡A
¦ý¬O¡A§Ú¥u¼gªº¥X¡A¸ê®Æ¬Û²Å«h¦^¼g¡A¸ê®Æ¤£²ÅªÌ«ç»ò¼g©O¡H
¥H¤U½d¨Ò¨Ó»¡¡AÀ³¸Ó¥u·|¦³sheet1ªº²Ä¤T¦C¸ê®Æ»Ý­n¦^¼g(22033107            C)
For i = 2 To 3
For j = 2 To 5

If Sheets("sheet2").Cells(j, 1) = Sheets("sheet1").Cells(i, 1) _
    And Sheets("sheet2").Cells(j, 2) = Sheets("sheet1").Cells(i, 2) Then

    -----------------------¡H¡H-------------------------
End If


Next
Next
End Sub

sheet1
¼t°Ó¥N¸¹        ³fª«¥N¸¹
25881846     D
22033107           B
22033107            C


sheet2
¼t°Ó¥N¸¹        ³fª«¥N¸¹
21155572     A
22033107            B
24599073            C
25881846     D

¦^´_ 1# eric093
  1. Sub nn()
  2.   Dim lRow As Long, lR As Long
  3.   Dim d

  4.   Set d = CreateObject("Scripting.Dictionary")
  5.   lRow = 2
  6.   With Sheets("Sheet2")
  7.     Do While .Cells(lRow, 1) <> ""
  8.       d(.Cells(lRow, 1) & "-" & .Cells(lRow, 2)) = lRow
  9.       lRow = lRow + 1
  10.     Loop
  11.   End With
  12.   
  13.   lRow = 2
  14.   lR = 1
  15.   With Sheets("Sheet1")
  16.     Do While .Cells(lRow, 1) <> ""
  17.       If d(.Cells(lRow, 1) & "-" & .Cells(lRow, 2)) = "" Then
  18.         Range(.Cells(lRow, 1), .Cells(lRow, 2)).Copy Sheets("Sheet3").Cells(lR, 1)
  19.         lR = lR + 1
  20.       End If
  21.       lRow = lRow + 1
  22.     Loop
  23.   End With
  24. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦³Ä@©ñ¦b¤ß¸Ì¡A¨S¦³¨­Åé¤O¦æ¡A¥¿¦p¯Ñ¥Ð¤£¼½ºØ¡A¬Ò¬OªÅ¹L¦]½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD