Sub deleteDouble()
'用户输入提示
Dim userInput
userInput = Application.InputBox("输入需要检查的起始行,结束行,以及需要检察的列,格式如 1,20,C")
Dim arrUserInput
arrUserInput = Split(userInput, ",")
Dim theColumn
theColumn = Asc(arrUserInput(2)) - 64 '需要进行检验的列
Dim theStart
theStart = arrUserInput(0) '数据的起始行
Dim theEnd
theEnd = arrUserInput(1) '最后一行数据的号码.
Dim i '每一行的号码
Dim j '
For i = theStart To theEnd '循环处理过程,如果数据比较大,可能耗费时间较多
For j = i + 1 To theEnd '从当前行至结尾.
If Cells(i, theColumn) = Cells(j, theColumn) Then
Rows(j).Delete
End If
Next
Next
End Sub