短消息收到,不会函数就使用代码吧:
Sub Macro1()
Dim c As Range, arr, brr, crr(), i As Long, r As Long
arr = Range("A2:A" & Range("A65536").End(3).Row)
ReDim crr(1 To UBound(arr), 1 To 2)
With Sheets("Sheet1")
brr = .UsedRange
For i = 1 To UBound(arr)
Set c = .Range("b:b").Find(arr(i, 1), , , xlWhole, , xlPrevious)
If Not c Is Nothing Then
r = c.Row
crr(i, 1) = brr(r, 1)
crr(i, 2) = brr(r, 7)
End If
Next
End With
Cells(2, 2).Resize(UBound(arr), 2).Value = crr
Cells(2, 2).Resize(UBound(arr)).NumberFormatLocal = "m""月""d""日"""
End Sub |