我从互联网上得到了这个 vba:
Sub MatchCompanyName_InsertContact_EmailAddress()
Dim hold As New Collection
For Each celli In Columns(6).Cells
On Error GoTo raa
If Not celli.Value = Empty Then
hold.Add Item:=celli.Row, key:="" & celli.Value
End If
Next celli
On Error Resume Next
raa:
Range("J1:L1").Offset(celli.Row - 1, 0).Value = Range("J1:L1").Offset(hold(celli.Value) - 1, 0).Value
Resume Next
End Sub
代码查找和替换顺序是从上到下,我需要它是相反的。