|
|
seelookme 发表于 2011-8-15 18:50 
请测试
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column > 1 Then Exit Sub
Dim c As Range, s$, firstAddress$
Set c = [a:a].Find(Target.Value, , , 1)
With [a:a]
Set c = [a:a].Find(Target.Value, , , 1)
If Not c Is Nothing Then
firstAddress = c.Address
Do
If c.Offset(, 12) <> "" Then s = s & vbCrLf & c.Offset(, 3) & "供应商," & Target & ":" & c.Offset(, 12) & "元"
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
If s <> "" Then MsgBox Mid(s, 2)
End Sub
|
|