简单建议你这样写
Dim startRange as range
Set startRange = range(“A1”)
Do while startRange.value <> “”
For i = 0 to 4
if application.countif(Range(startRange,startRange.offset(0,4)),startRange.o
ffset(0,i))=2 then
startRange.offset(0,5)=startRange.offset(0,i).value
End if
Next i
set startRange = startRange.offset(1,0)
Loop