|
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False
Dim arr
If Selection.Count > 1 Then Exit Sub
r = Target.Row: j = Target.Column
If r < 3 Then Exit Sub
If IsEmpty(Cells(r, 3)) = True Or IsEmpty(Cells(r, 6)) = True Then Exit Sub
Set d = CreateObject("Scripting.Dictionary")
xrow = Sheets("数据").Range("F65536").End(xlUp).Row
arr = Sheets("数据").Range("A1:H" & xrow)
For i = 2 To xrow
d(arr(i, 6) & arr(i, 7) & "") = arr(i, 8)
Next i
Cells(r, 9) = d(Cells(r, 3) & Cells(r, 6) & "")
Application.ScreenUpdating = True
End Sub
|
|