【发布时间】:2020-05-02 23:39:11
【问题描述】:
我需要检查 column B 中的重复项,我编写了以下代码,看起来没问题,但我得到了 Run time Error 13 type-mismatch 请帮忙。为什么我会得到它?
Sub duplicate()
Dim myRange As Range
Dim myCell As Range
Set myRange = Columns("B:B")
For Each myCell In myRange
If WorksheetFunction.CountIf(myRange, myCell.Value) > 1 Then ' Run-time error 13 Type mismatch
myCell.Interior.ColorIndex = 3
End If
Next myCell
End Sub
更新: 更多信息请关注https://www.youtube.com/watch?v=drZK_-zzo_4
【问题讨论】:
标签: excel vba duplicates runtime-error type-mismatch