|
我曾答过你的问题。
就你提供的附件及你对问题的描述,第一个问题应是解决了,你得积极正面的评价!
这是你的第二个问题,我在这里还是答复一下,你可不要让答题人灰心……
Sub test()
Application.ScreenUpdating = False
Dim d As Object, ar, lr&, r&, f$
f = ThisWorkbook.Path & "\B.xlsx"
If Dir(f) <> "" Then
Set d = CreateObject("scripting.dictionary")
With Workbooks.Open(f)
With .Worksheets(1)
ar = .Range("d1:d" & .Cells(.Rows.Count, 4).Row)
End With
.Close 0
End With
For r = 2 To UBound(ar)
If Len(ar(r, 1)) Then d(ar(r, 1)) = ""
Next
With ActiveSheet
With .Range("c1:c" & .Cells(.Rows.Count, 3).Row)
.Interior.Pattern = xlNone
ar = .Value
End With
For r = 2 To UBound(ar)
If d.exists(ar(r, 1)) Then .Range("c" & r).Interior.Color = vbYellow
Next
End With
Set d = Nothing
End If
Application.ScreenUpdating = True
MsgBox "ok!"
End Sub |
评分
-
1
查看全部评分
-
|