- ©«¤l
- 185
- ¥DÃD
- 47
- ºëµØ
- 0
- ¿n¤À
- 227
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN 7
- ³nÅ骩¥»
- ºX舰ª©
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-9-14
- ³Ì«áµn¿ý
- 2024-11-19
|
§Ú¸Õ¥ÎlastChar = Right(Tr(1), 1)¨Ó¦sÀx·í«e¤Ç°tÁ䪺³Ì«á¤@Ó¦r²Å,µM«áÀˬd¤U¤@ӳ椸®æªº¤º®e»PlastChar¤£¦P, ¤~¶}©lÄ~Äò¦bL¦C¦V¤UÀˬd,¦ý¤´µM¤£¦¨¥\- Sub Test_A1()
- Dim Arr, A, Brr, xD, i&, j&, T$, Tr, R, lastChar$
- Set xD = CreateObject("Scripting.Dictionary") '³Ð«Ø¤@Ó¦r¨å¹ï¶H
- '¹M¾ú¤@ӼƲաA¨Ã±N¨CÓ¤¸¯À«ö"\"¤À³Î¡AµM«á±N¤À³Î«áªº²Ä¤G³¡¤À§@¬°Áä¡A²Ä¤@³¡¤À§@¬°È¦s¤J¦r¨å
- For Each A In Array("1^12\ÀuÀu¨}", "2^10\¨}¨}Àu", "3^3\ÀuÀuÀu", "4^3\¨}¨}¨}", _
- "5^3\Àu¨}", "6^3\¨}Àu", "7^-3\ÀuÀu", "8^-10\¨}¨}")
- Tr = Split(A, "\")
- xD(Tr(1)) = Tr(0)
- Next A
- 'Ū¨úExcel¤u§@ªí¤¤ªº¤@Ó½d³ò¨ìArr¼Æ²Õ¡AµM«á®Ú¾ÚArrªº¤j¤p«·s©w¸qBrr¼Æ²Õ
- Arr = Range([L1], [L65536].End(xlUp)(5))
- ReDim Brr(1 To UBound(Arr), 0)
- 'Ãö³¬«Ì¹õ§ó·s¡A¥H´£°ª¥N½X°õ¦æ³t«×
- Application.ScreenUpdating = False
- '¹M¾úArr¼Æ²Õ¡A¨Ã®Ú¾Ú¦r¨å¤¤ªº±ø¥Ø¹ïExcel¤u§@ªí¤¤ªº¬Y¨Ç³æ¤¸®æ¶i¦æ®æ¦¡¤Æ
- For i = 2 To UBound(Arr) - 4
- T = Arr(i, 1)
- If T <> Arr(i - 1, 1) Then
- For j = i + 1 To i + 2
- T = T & Arr(j, 1)
- R = xD(T)
- If R <> "" Then
- Tr = Split(R, "^")
- lastChar = Right(Tr(1), 1)
- If Arr(j + 1, 1) <> lastChar Then
- With Range("L" & i & ":L" & j)
- .BorderAround 1
- .Interior.ColorIndex = Cells(Tr(0) + 2, 1).Interior.ColorIndex
- End With
- Brr(j - 1, 0) = Tr(1): i = j: Exit For
- End If
- End If
- Next j
- End If
- Next i
- '±NBrr¼Æ²Õªº¤º®e¼g¤JExcel¤u§@ªíªº¤@Ó½d³ò
- [o2].Resize(UBound(Brr)) = Brr
- End Sub
½Æ»s¥N½X |
|