- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-10-21
|
¥»©«³Ì«á¥Ñ Andy2483 ©ó 2023-3-23 11:47 ½s¿è
¦^´_ 1# KITTYBOY
¦^´_ 8# Hsieh
ÁÂÁ½׾Â,ÁÂÁ«e½ú
«á¾ÇÂǦ¹©«½Æ²ß ¦b¦P¤@°}¦C¸Ì¦¬¶°µ²ªG¸ê®Æ,±N§½³¡¸ê®Æ(µ²ªG¸ê®Æ)¼g¤JÀx¦s®æ,
¾Ç²ßªº¤è®×¦p¤U,½Ð¦U¦ì«e½ú«ü±Ð
ì©l¸ê®Æ:
°õ¦æµ²ªG1:
°õ¦æµ²ªG2:²£¥Í¤@Ó·s¬¡¶Ã¯
Option Explicit
Sub TEST()
Dim Brr, i&, Tr&, TT&, N&, Tf$, Tg$, j%
'¡ô«Å§iÅܼÆ:Brr¬O³q¥Î«¬ÅܼÆ,(i,Tr,TT,N)¬Oªø¾ã¼ÆÅܼÆ,
'(Tf,Tg)¬O¦r¦êÅܼÆ,j¬Oµu¾ã¼ÆÅܼÆ
Brr = Range([R1], Cells(Rows.Count, "E").End(xlUp))
'¡ô¥OBrr³o³q¥Î«¬ÅܼƬO ¤Gºû°}¦C,¥H[R1]¨ì EÄæ³Ì«á¦³¤º®eÀx¦s®æȱa¤J
For i = 2 To UBound(Brr)
'¡ô³]¶¶°j°é!i±q2¨ì Brr°}¦CÁa¦V³Ì¤j¯Á¤Þ¦C¸¹
Tf = Trim(Brr(i, 2)): Tg = Brr(i, 3): Tr = Val(Brr(i, 14))
'¡ô¥OTf³o¦r¦êÅܼƬO i°j°é¦C²Ä2ÄæBrr°}¦CÈ¥h°£ÀY§ÀªÅ¥Õ¦r¤¸ªº·s¦r¦ê
'¡ô¥OTg³o¦r¦êÅܼƬO i°j°é¦C²Ä3ÄæBrr°}¦CȪº·s¦r¦ê
'¡ô¥OTr³oªø¾ã¼ÆÅܼƬO i°j°é¦C²Ä14ÄæBrr°}¦CȸgÂà¤Æ¬°¼ÆȪº¾ã¼Æ
If Tf Like "CC*" Then
'¡ô¦pªGTfÅܼƬO¥H "CC"¦r¦ê¶}ÀY?
If Tg Like "*¤é¥ß*" Or Tg Like "*MCL*" Then
'¡ô¦pªG TgÅܼƸ̥]§t"¤é¥ß"¦r¦ê,©Î TgÅܼƸ̥]§t"MCL"¦r¦ê?,
'³o¨âӨ䤤¥un¦³¤@Ó±ø¥ó¦¨¥ß?
TT = TT + Tr: N = N + 1
'¡ô¥OTT³oªø¾ã¼ÆÅܼƬO TTÅܼƦۨ + TrÅܼÆ,
'¥ON³oªø¾ã¼ÆÅܼƲ֥[ 1 (PS:NÅܼƤ@¶}©lªºªì©lȬO0)
'(NÅܼƬOn«ü©w²Å¦X±ø¥óªº¸ê®Æn³°Äò©ñ¦bBrr°}¦CªºþÓ¦C¦ì)
For j = 1 To UBound(Brr, 2): Brr(N + 1, j) = Brr(i, j): Next
'¡ô³]¶¶°j°é!j±q1¨ì Brr°}¦C¾î¦V³Ì¤j¯Á¤ÞÄ渹,
'¥O(NÅܼÆ+1)¦C²ÄjÅܼÆÄ檺Brr°}¦CȬO i°j°é¦C²ÄjÅܼÆÄ檺Brr°}¦CÈ
End If
End If
Next
[B2] = TT
'¡ô¥O[B2]Àx¦s®æȬO TTÅܼÆ
Workbooks.Add
'¡ô¥O²£¥Í¤@Ó·sªº¬¡¶Ã¯
[A1].Resize(N + 1, UBound(Brr, 2)) = Brr
'¡ô¥O·s¬¡¶Ã¯²Ä1Ó¤u§@ªíªº[A1]Àx¦s®æÂX®i¦V¤U NÅܼÆ+1¦C,
'¦V¥kÂX®i Brr°}¦C¾î¦V³Ì¤j¯Á¤ÞÄ渹¼ÆÄæ,³o½d³òÀx¦s®æÈ ¥HBrr°}¦Cȱa¤J
Cells.Columns.AutoFit
'¡ô¥O¾ãÓ¤u§@ªí¥þ³¡Äæ¦ì ¦Û°Ê½Õ¾ãÄæ¼e
ActiveWindow.Zoom = 75
'¡ô¥Oµøµ¡Åã¥Ü75%
'100 ªí¥Ü¥¿±`¤j¤p¡B200 ªí¥ÜÂù¿¤j¤p¡A¨Ì¦¹Ãþ±À)
MsgBox TT
'¡ô¥O¸õ¥X´£¥Üµ¡Åã¥Ü: TTÅܼÆÈ
Erase Brr
End Sub |
|