¼ÐÃD:
[µo°Ý]
µLªkºë½T¤ñ¹ï
[¥´¦L¥»¶]
§@ªÌ:
jesscc
®É¶¡:
2011-9-13 23:25
¼ÐÃD:
µ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
[attach]7800[/attach]
§@ªÌ:
chin15
®É¶¡:
2011-9-14 00:05
Sub ex()
Set d = CreateObject("Scripting.Dictionary")
With Sheet1
For Each a In .Range(.[B5], .[B56636].End(xlUp))
d(a & "") = Array(a.Offset(, 1).Value, a.Offset(, 2).Value, a.Offset(, 3).Value, a.Offset(, 4).Value)
Next
End With
With Sheet2
For Each a In .Range(.[D12], .[D56636].End(xlUp))
If d.exists(a & "") Then a.Offset(, 4).Resize(, 4) = d(a & "")
Next
End With
End Sub
½Æ»s¥N½X
§@ªÌ:
jesscc
®É¶¡:
2011-9-14 00:42
¦^´_
2#
chin15
ì¨Óºë½T¤ñ¹ïn¥Îexists¨ç¼Æ¡C
ÁÂÁÂc¤j³o»ò§Ö´NÀ°§Ú¸Ñ¨M°ÝÃD¤F^^
§@ªÌ:
GBKEE
®É¶¡:
2011-9-14 06:26
¦^´_
1#
jesscc
Sub Ex()
Dim D As Object, A As Range
Set D = CreateObject("Scripting.Dictionary")
With Sheet1
For Each A In .Range(.[B5], .[B56636].End(xlUp))
D(A & "") = A.Offset(, 1).Resize(, 4).Value
Next
End With
With Sheet2
For Each A In .Range(.[D12], .[D56636].End(xlUp))
A.Offset(, 4).Resize(, 4) = D(A & "")
Next
End With
Set D = Nothing
Set A = Nothing
End Sub
½Æ»s¥N½X
§@ªÌ:
jesscc
®É¶¡:
2011-9-14 22:00
¦^´_
4#
GBKEE
ÁÂÁÂG¤jªºÀ°¦£
³Ì«áªº
14.Set D = Nothing
15.Set A = Nothing
¬O¤°»ò·N«ä°Ú?
¬O§_Dim«á±¦³«Å§i¨ìªº¡A³£n³o¼Ë³B²z¶Ü?
§@ªÌ:
GBKEE
®É¶¡:
2011-9-15 06:23
¦^´_
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
§@ªÌ:
jesscc
®É¶¡:
2011-9-15 20:45
¦^´_
6#
GBKEE
¤j·§¤F¸Ñ·N«ä¤F¡AÁÂÁÂG¤j
Åwªï¥úÁ{ ³Â»¶®a±Ú°Q½×ª©ª© (http://forum.twbts.com/)