
将下面vba抄入 "模块"
在vba第2行输入要处理的区域
执行vba
Sub XXX1()
'删除设定区域内的重复字
Dim rng: Set rng = [b2:f9] '在这行设定处理区域
On Error Resume Next
Dim ans: ans = MsgBox("确定删除这区域内的重复内容" & Chr(13) & Chr(13) _
& Chr(9) & ActiveSheet.Name & "!" & rng.Address(0, 0), vbYesNo, "温馨提示")
If ans = 7 Then
MsgBox "程序结束"
Exit Sub
End If
Dim dic, cell, cv
Set dic = CreateObject("Scripting.Dictionary")
For Each cell In rng
cv = cell.Value
If cv = "/" Then GoTo 333 '设定例外字元
If dic.exists(cv) Then
cell.ClearContents
Else
dic(cv) = ""
End If
333
Next
On Error GoTo 0
Set dic = Nothing
End Sub