- ©«¤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
|
¦^´_ 3# 44754875
½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁ¡C
Sub test()
Dim WB, Arr, Brr, xD, Ar, a, a1, fc%, x%, fn$, n%, i&, j%, iPos%, iLen%, iPos1%
Application.ScreenUpdating = False: Application.DisplayAlerts = False
Application.AskToUpdateLinks = False
Set xD = CreateObject("Scripting.Dictionary")
Brr = Sheets(1).Range([ì©l!d1], [ì©l!d65536].End(3))
With Sheets(2)
If .FilterMode Then .ShowAllData
.[d1].Resize(UBound(Brr)) = Brr
.[d1].Resize(UBound(Brr)).Font.ColorIndex = 1
End With
With Application.FileDialog(msoFileDialogOpen)
.InitialFileName = "D:\"
.AllowMultiSelect = True
.Show
fc = .SelectedItems.Count
If fc = 0 Then Exit Sub
Tm = Timer
For x = 1 To fc
FPath = .SelectedItems(x)
Set WB = Workbooks.Open(FPath)
With Sheets(1)
If .FilterMode Then .ShowAllData
Arr = .Range("d1:d" & .[d65536].End(3).Row)
For i = 2 To UBound(Arr)
Ar = Split(Arr(i, 1), Chr(10))
For j = 0 To UBound(Ar)
a = Split(Ar(j), ":")(0): a1 = Split(Ar(j), ":")(1): xD(a & "") = a1
Next
Next
End With
WB.Close
For i = 2 To UBound(Brr)
Ar = Split(Brr(i, 1), Chr(10))
For j = 0 To UBound(Ar)
a = Split(Ar(j), ":")(0): a1 = Split(Ar(j), ":")(1)
If xD.Exists(a & "") Then
If a1 <> xD(a & "") Then
Sheets(2).Cells(i, 4) = Replace(Cells(i, 4), a1, "§ó·s-" & xD(a & ""))
End If
End If
Next
Next
xD.RemoveAll
Next
End With
With Sheets(2)
Arr = .Range("d1:d" & .[d65536].End(3).Row)
For i = 2 To UBound(Arr)
Ar = Split(Arr(i, 1), Chr(10))
For j = 0 To UBound(Ar)
a = Split(Ar(j), ":")(0): a1 = Split(Ar(j), ":")(1)
iPos = InStr(a1, "§ó·s-"): iLen = Len(a1) + 5: iPos1 = InStr(Cells(i, 4), a)
If iPos > 0 Then: .Cells(i, 4).Characters(iPos1, iLen).Font.ColorIndex = 3
Next
Next
End With
Application.ScreenUpdating = True: Application.DisplayAlerts = True
Application.AskToUpdateLinks = True
MsgBox "°õ¦æ§¹¦¨" & Timer - Tm & " ¬í"
End Sub |
|