相关疑难解决方法(0)

建议宏在SINGLE列中查找重复项

发现了很多涉及在两列中查找重复项的问题:

MS Excel如何创建一个宏来查找重复项并突出显示它们?excel标记重复值

但是,我正在尝试调整代码以用于在一列中查找重复项.例如,这是一个数据集:

第1栏

Foo
Bar
23
23
12
foo
Bar
bart

这就是我现在正在使用的:

Function warnDupes()

Dim lastRow As Long
Dim dict As Object

' Let Col be the column which warnDupes operates on.
Dim Col As String

Col = "A"

Set dict = CreateObject("scripting.dictionary")

lastRow = range(Col & Rows.Count).End(xlUp).Row

On Error Resume Next
For i = lastRow To 1 Step -1
    If dict.Exists(range(Col & i).value) = True Then

    'range("Y" & i).EntireRow.Delete

    MsgBox ("Hmm...Seems to be a …
Run Code Online (Sandbox Code Playgroud)

sorting excel vba excel-vba

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

excel ×1

excel-vba ×1

sorting ×1

vba ×1