|
- Sub lqxs()
- Dim Arr, i&, m&, d
- Set d = CreateObject("Scripting.Dictionary")
- Sheet3.Activate
- [a2:h5000].ClearContents
- [a2:h5000].Borders.LineStyle = xlNone
- Arr = Sheet1.[a1].CurrentRegion
- m = UBound(Arr)
- [a1].Resize(UBound(Arr), 6) = Arr
- For i = 2 To UBound(Arr)
- d(Arr(i, 2)) = i
- Next
- Arr = Sheet2.[a1].CurrentRegion
- For i = 2 To UBound(Arr)
- If d.exists(Arr(i, 1)) Then
- Cells(d(Arr(i, 1)), 7) = Arr(i, 2)
- Else
- m = m + 1
- Cells(m, 2) = Arr(i, 1): Cells(m, 7) = Arr(i, 2)
- End If
- Next
- [a1].CurrentRegion.Borders.LineStyle = 1
- End Sub
复制代码 |
|