第1个回答 2017-05-10
Dim C_Address, D_Address
If [e15].End(xlUp).Row > 1 Then
For i = 2 To [e15].End(xlUp).Row
Set c = [G1:U1].Find(Range("E" & i), , , xlWhole)
If Not c Is Nothing Then
C_Address = c.Address
temp = ""
Do
temp = temp & Split(c.Address, "$")(1) & ","
Set c = [G1:U1].FindNext(c)
Loop While Not c Is Nothing And c.Address <> C_Address
End If
If temp <> "" Then
arr = Split(Left(temp, Len(temp) - 1), ",")
For j = 0 To UBound(arr)
Set D = Range(arr(j) & "2:" & arr(j) & "15").Find(Range("d" & i), , , xlWhole)
If Not D Is Nothing Then
D_Address = D.Address
Do
Range("B" & D.Row) = Range("B" & D.Row) + 1
Set D = Range(arr(j) & "2:" & arr(j) & "15").FindNext(D)
Loop While Not D Is Nothing And D.Address <> D_Address
End If
Next
End If
Next
End If本回答被网友采纳