- ©«¤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-12-18
|
¥»©«³Ì«á¥Ñ samwang ©ó 2021-8-30 11:45 ½s¿è
¦^´_ 9# ML089
§Ú¬O«Ü²Ê¤ßªº¤H¡A¥u¬Oè¦n¬Ý¨ì¦¹°ÝÃD¡A
¥t¥~¡A¬Ý¨ìª©¥D¸Ñµª¡A¤]¾Ç²ß¤@¤U¦Ó·Q¨ì¸Ñªk¡A·PÁ¡C
Sub test()
Dim xD, xD1, Ar(), Ar1(), T$, ky, L%, i&, j%, n%, n1%, xP%, xP1
Set xD = CreateObject("Scripting.Dictionary")
Set xD1 = CreateObject("Scripting.Dictionary")
xR = Range("b3")
For j = 0 To UBound(Split(xR, ","))
T = Split(xR, ",")(j): xD(T) = xD(T) + 1
Next
xR1 = Range("c3")
For j = 0 To UBound(Split(xR1, ","))
T = Split(xR1, ",")(j): xD1(T) = xD1(T) + 1
Next
For Each ky In xD
If Not xD1.exists(ky) Then: ReDim Preserve Ar(n): Ar(n) = ky: n = n + 1
Next
For Each ky In xD1
If Not xD.exists(ky) Then: ReDim Preserve Ar1(n1): Ar1(n1) = ky: n1 = n1 + 1
Next
If n1 > 0 Then
For j = 0 To UBound(Ar1)
T = Ar1(j): L = Len(T)
For j1 = 1 To xD1(T)
If j1 = 1 Then
pos = InStr(Range("c3"), T)
Else
pos = InStr(xP, Range("c3"), T)
End If
Range("c3").Characters(pos, L).Font.ColorIndex = 3
xP = pos + 2
Next
Next
End If
If n > 0 Then
For j = 0 To UBound(Ar)
T = Ar(j): L = Len(T)
For j1 = 1 To xD(T)
If j1 = 1 Then
pos = InStr(Range("b3"), T)
Else
pos = InStr(xP1, Range("b3"), T)
End If
Range("b3").Characters(pos, L).Font.ColorIndex = 3
xP1 = pos + 2
Next
Next
End If
End Sub |
|