- ©«¤l
- 976
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 1018
- ÂI¦W
- 0
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-4-19
- ³Ì«áµn¿ý
- 2024-10-30
|
¦^´_ 13# BV7BW
Sub tt1()
Dim Arr, i&, N%, T, pos%, pos2%, pos3%
Sheets("¤u§@ªí2").Range("A4:D1000") = "" '²M°£¤u§@ªí2ªº¸ê®Æ
T = [¤u§@ªí2!C2] '¬d§ä¦r
Arr = Range([¤u§@ªí3!G1], [¤u§@ªí3!D65536].End(3)) '±N¤u§@ªí3¸ê®ÆD~GÄæ¦ì¸ê®Æ©ñ¦b¼Æ²Õ¤¤
For i = 2 To UBound(Arr)
pos = InStr(Arr(i, 1), T): pos2 = InStr(Arr(i, 2), T)
pos3 = InStr(Arr(i, 3), T) '¬d¸ß¦r½T»{¦³µL¦b¤u§@ªí3ªºD¡BE¡BFÄæ
If pos > 0 Or pos2 > 0 Or pos3 > 0 Then '¦³§ä¨ì®É
N = N + 1: Arr(N, 1) = Format(N, "00") '¦³¸ê®Æ®ÉArrªº²Ä1Äæ¦ì¡A¦Û°Ê²£¥Í§Ç¸¹
For j = 2 To 4: Arr(N, j) = Arr(i, j - 1): Next '±N¤u§@ªí3¸ê®ÆD¡BE¡BFÄæ¸ê®Æ¼È®É¦s©ñ¦bArr
End If
Next
If N > 0 Then '½T»{¦³µL§ä¨ì¸ê®Æ
With Sheets("¤u§@ªí2")
.Range(.[A4], .Cells(N + 3, 1)).NumberFormatLocal = "@" 'AÄæ§ï¬°¤å¦r®æ¦¡
.[A4].Resize(N, 4) = Arr '¦³§ä¨ì¸ê®Æ±Ï¦^¶ñ¦Ü¤u§@ªí2
End With
End If
End Sub |
|