- ©«¤l
- 254
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 310
- ÂI¦W
- 0
- §@·~¨t²Î
- W10
- ³nÅ骩¥»
- Excel 2016
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2019-6-16
- ³Ì«áµn¿ý
- 2024-9-23
|
¦^´_ 12# PJChen
Sub ¹w¬ù§ó·s_2()
Application.ScreenUpdating = False 'Ãö³¬§ó·sµe±
'§â¤u§@ªíªº©Ò¦³¤º®e©ñ¨ì°}¦C
Arr = [»¡©ú!I2].CurrentRegion
Brr = [¹w¬ù!A1].CurrentRegion
For X = 2 To UBound(Arr) '¦b°}¦C¸Ìªº²Ä2¦C¶}©l¨ì³Ì«á¤@¦C
A = Arr(X, 1) & "-" & Arr(X, 4) '»¡©ú¤å¦r ±b¸¹¦êÁp¤é´Á
For Y = X To UBound(Brr) '¦b°}¦C¸Ìªº²Ä2¦C¶}©l¨ì³Ì«á¤@¦C
B = Brr(Y, 2) & "-" & Brr(Y, 1) '¹w¬ù¤å¦r ±b¸¹¦êÁp¤é´Á
If A = B And Brr(Y, 3) = "" Then K = 0 '¦pªG»¡©ú¤å¦r»P¹w¬ù¤å¦r¬Û¦P ¥B¹w¬ùX¦C¦ìªº²Ä3Äæ¦ì¨S¦³¤º®e K´Nµ¥©ó0 ªí¥Ü¨S¦³³Q¤ñ¹ï¹L
If A = B And Arr(X, 4) <> "" And K <> 1 Then '¦pªG»¡©ú¤å¦rªº»P¹w¬ù¤å¦r¬Û¦P ¥B»¡©úX¦C¦ìªº²Ä4Äæ¦ì¦³¤º®e ¥BK¤£µ¥©ó1 ªí¥Ü¨S¦³³Q¤ñ¹ï¹L
K = 1 'ªí¥Ü¤w¸g³Q¤ñ¹ï¹L
Cells(Y, 3) = Arr(X, 7) '§â»¡©úªº¹w¬ùªO¼Æ©ñ¨ì¹w¬ù¤u§@ªíªº³æ¶µ¨úªOÄæ¦ì
Cells(Y, 7) = "#0000" & Arr(X, 5) '§â»¡©úªº "#0000"¦êÁp¨úªO½s¸¹ ©ñ¨ì¹w¬ù¤u§@ªíªº¨úªO½s¸¹Äæ¦ì
Exit For '¸õ¨ì¤U¤@Ó°j°é
End If
Next Y
Next X
'D:FÄ檺¤½¦¡È¤Æ ¬O¦]¬° Brr = [¹w¬ù!A1].CurrentRegion ªºÃö«Y ©Ò¦³¤º®e©ñ¨ì°}¦C ©Î§ï¦¨¯S©w¦ì¸m
'[¹w¬ù!A1].Resize(UBound(Brr, 1), UBound(Brr, 2)) = Brr ¦]¬°¨S¦³¦b°}¦C¸Ì¤ñ¹ï©Ò¥H¤£»Ýn
Brr«üªº¬O¹w¬ù¤u§@ªí¤ñ¹ï«áªº¤º®e
¨ä¹ê¥Î¦r¨å¤èªk·|§ó¦n ¦ý¤p§ÌÁÙ¦b¾Ç²ß¤¤¤£¤Ó²z¸Ñ...¦³ªÅÁÙ¬O·|¨Ó¬Ý¬Ý¤j¤jÌ«ç»ò¼g.¶¶«K¾Ç²ß^^"
Application.ScreenUpdating = True '¶}±Ò§ó·sµe±
End Sub |
|