第1个回答 2010-10-03
按ALT+F11,打开VBA编辑器,菜单-插入-模块-右边空白处粘贴以下代码,按F5完成。
Sub Macro1()
Dim w(30000)
Range("c1:c65536").ClearContents
s = 1
For i = 1 To 10
For j = 1 To 2
If Cells(i, j) <> "" Then w(s) = Cells(i, j): s = s + 1
Next j
Next i
For i = 1 To s - 2
For j = i + 1 To s - 1
If w(j) = w(i) Then w(j) = ""
Next j
Next i
p = 1
For i = 1 To s - 1
If w(i) <> "" Then Cells(p, "c") = w(i): p = p + 1
Next i
End Sub