- ©«¤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
|
¥»©«³Ì«á¥Ñ samwang ©ó 2021-8-30 14:31 ½s¿è
¦^´_ 6# free72921
¨Ò¦p¡G
¸õ¥X¸ß°Ýµøµ¡¡i½Ð¿ï¾Ü½d³òA¡j
¸õ¥X¸ß°Ýµøµ¡¡i½Ð¿ï¾Ü½d³òB¡j
¦A¥H³Q¿ï©wªº2Ó½d³ò¶}©l¶i¦æ¤ñ¹ï
>> ¦p¤U¡A½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ
Sub test2()
Dim R, xR, xR1, xD, xD1, Ar(), Ar1(), ky
Dim T$, L%, i&, j%, n%, n1%, xP%, xP1%, pos%
Set xD = CreateObject("Scripting.Dictionary")
Set xD1 = CreateObject("Scripting.Dictionary")
On Error Resume Next
Set xR = Application.InputBox("½Ð¿ï¾ÜRange:", Type:=8)
Set xR1 = Application.InputBox("½Ð¿ï¾ÜRange:", Type:=8)
For Each R In xR: For j = 0 To UBound(Split(R, ","))
T = Split(R, ",")(j): xD(T) = xD(T) + 1
Next j: Next R
For Each R In xR1: For j = 0 To UBound(Split(R, ","))
T = Split(R, ",")(j): xD1(T) = xD1(T) + 1
Next j: Next R
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)
For Each R In xR1
T = Ar1(j): L = Len(T): xP = 1
For j1 = 1 To xD1(T)
pos = InStr(xP, R, T, 0)
If pos > 0 Then
R.Characters(pos, L).Font.ColorIndex = 3
xP = pos + 2
End If
Next j1
Next R
Next j
End If
If n > 0 Then
For j = 0 To UBound(Ar)
For Each R In xR
T = Ar(j): L = Len(T): xP1 = 1
For j1 = 1 To xD(T)
pos = InStr(xP1, R, T, 0)
If pos > 0 Then
R.Characters(pos, L).Font.ColorIndex = 3
xP1 = pos + 2
End If
Next j1
Next R
Next j
End If
End Sub |
|