VBA检查重复数据并做出执行

发布网友

我来回答

1个回答

热心网友

Sub 宏1()
    Set db = CreateObject("Scripting.Dictionary")
    for i = 2 to ActiveSheet.UsedRange.Rows.Count
        If i<=14 Then
            db(Trim(Cells(i,3)) = True
        Else
            If db(Trim(Cells(i,3)) Then
                MsgBox "第"& i &"行数据【"& Cells(i,3) &"】重复!"
            Else
                With Range(Cells(i,1), Cells(i,6)).Borders
                    .LineStyle = xlContinuous
                    .Weight = xlMedium
                End With
            End If
        End If
    next i
End Sub

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com