ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] 2Àx¦s®æ¤¤¦r¦ê®t²§Åã¥Ü

¥»©«³Ì«á¥Ñ 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

TOP

¦^´_ 11# samwang


    ·PÁ«e½ú¡A´ú¸Õµ²ªG¹B¦æ§¹¬ü¡C

¤p§Ì¦Û§@Áo©ú§â¼u¸õµøµ¡ªº´£¥Ü­×¤F¤@¤U¡i½Ð¿ï¾ÜRange A¡j¡i½Ð¿ï¾ÜRange B¡j¡A³o¼Ë¤ñ¸û¦³¥Ü·N2­Ó¤£¦P½d³òªº·Pı¡A

«D±`·PÁ±z»P¦U¦ì«e½úªº¨ó§U¡C

TOP

        ÀR«ä¦Û¦b : §Ú­Ì³Ì¤jªº¼Ä¤H¤£¬O§O¤H¡D¥i¯à¬O¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD