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

[µo°Ý] µLªkºë½T¤ñ¹ï

[µo°Ý] µLªkºë½T¤ñ¹ï

¥ÎSheets2 --DÄ檺¸ê®Æ¥h¸òSheets1--BÄ檺¸ê®Æ¤ñ¹ï¡A§ä¨ì§¹¥þ¬Û¦Pªº´N§âSheets1¤¤¦P¤@¦Cªº¬ÛÃö¸ê®Æ¶K¨ìSheets2ªº¬Û¹ï¦ì¸m¤¤
¥i¬O¦n¹³¨S¿ìªk°µ¨ìºë½T¤ñ¸û¡A´ú¸ÕÀɤ¤À³¸Ó¥u¦³²Ä7µ§¯à¤ñ¹ï¨ì¡A¥i¬O«o¤ñ¹ï¥X²{3µ§¡C
test.rar (14.03 KB)
Jess

  1. Sub ex()
  2. Set d = CreateObject("Scripting.Dictionary")
  3. With Sheet1
  4. For Each a In .Range(.[B5], .[B56636].End(xlUp))
  5.    d(a & "") = Array(a.Offset(, 1).Value, a.Offset(, 2).Value, a.Offset(, 3).Value, a.Offset(, 4).Value)
  6. Next
  7. End With
  8. With Sheet2
  9. For Each a In .Range(.[D12], .[D56636].End(xlUp))
  10.        If d.exists(a & "") Then a.Offset(, 4).Resize(, 4) = d(a & "")
  11.     Next
  12. End With
  13. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# chin15

    ­ì¨Óºë½T¤ñ¹ï­n¥Îexists¨ç¼Æ¡C
ÁÂÁÂc¤j³o»ò§Ö´NÀ°§Ú¸Ñ¨M°ÝÃD¤F^^
Jess

TOP

¦^´_ 1# jesscc
  1. Sub Ex()
  2. Dim D As Object, A As Range
  3. Set D = CreateObject("Scripting.Dictionary")
  4. With Sheet1
  5. For Each A In .Range(.[B5], .[B56636].End(xlUp))
  6.    D(A & "") = A.Offset(, 1).Resize(, 4).Value
  7. Next
  8. End With
  9. With Sheet2
  10. For Each A In .Range(.[D12], .[D56636].End(xlUp))
  11.     A.Offset(, 4).Resize(, 4) = D(A & "")
  12. Next
  13. End With
  14. Set D = Nothing
  15. Set A = Nothing
  16. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# GBKEE


    ÁÂÁÂG¤jªºÀ°¦£
³Ì«áªº
14.Set D = Nothing
15.Set A = Nothing
¬O¤°»ò·N«ä°Ú?
¬O§_Dim«á­±¦³«Å§i¨ìªº¡A³£­n³o¼Ë³B²z¶Ü?
Jess

TOP

¦^´_ 5# jesscc
=> ÄÀ©ñ°O¾ÐÅé
VBA ªº»¡©ú   
Nothing ÃöÁä¦r¬O¥Î¨Ó±N¤@­Óª«¥óÅܼƱq¤@­Ó¹ê»Úªºª«¥óùؤÀÂ÷¶}¨Ó¡C¨Ï¥Î Set ³¯­z¦¡¥i«ü©w Nothing µ¹ª«¥óÅܼơCÁ|¨Ò¨Ó»¡¡G
Set MyObject = Nothing
¼Æ­Óª«¥óÅܼƥi¥H¦P®É¤Þ¥Î¤@­Ó¹ê»Úª«¥ó¡A¦Ó·í Nothing ³Q«ü©wµ¹¤@­Óª«¥óÅܼơA¨º»ò¸ÓÅܼƱN¤£¦A¤Þ¥Î¥ô¦ó¹ê»Úª«¥ó¡C·í¼Æ­Óª«¥óÅܼƦP®É¤Þ¥Î¤@­Óª«¥ó¡A¨º»ò©M¸Óª«¥ó¦³Ãö³sªº°O¾ÐÅé¡B¨t²Î¸ê·½¤¤³Qª«¥óÅܼƩҤޥΨ쪺³¡¥÷¡A¥u¦³¦b¥þ³¡ªºª«¥óÅܼƳ£³]¦¨ Nothing «á¤~·|³QÄÀ©ñ¡C¦ÓÅܼƳQ³]¦¨ Nothing ªº¤èªk¤£¥~¬Oª½±µ¨Ï¥Î Set¡A©Îµ¥«Ý³Ì«á³Q³]¦¨ Nothing ªºª«¥óÅܼƶW¥X½d³ò¤§«á¡C

TOP

¦^´_ 6# GBKEE


    ¤j·§¤F¸Ñ·N«ä¤F¡AÁÂÁÂG¤j
Jess

TOP

        ÀR«ä¦Û¦b : ªY½à§O¤H´N¬O²øÄY¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD