发布网友 发布时间:2022-04-24 05:43
共2个回答
热心网友 时间:2023-11-02 01:00
Sub a()
Dim i As Long, iRow As Long
Dim strColorCell As String
iRow = Range("C60000").End(xlUp).Row
For i = 3 To iRow
If WorksheetFunction.CountIf(Range("C:C"), Range("C" & i)) > 1 Then
Range("C" & i).Interior.Color = RGB(255, 255, 0)
strColorCell = Range("C" & i).Address & Chr(10) & strColorCell
End If
Next
MsgBox strColorCell
End Sub
Alt+F11打开编辑窗口,插入模块,复制粘贴代码,F5运行。
代码说明:对C列进行检查,存在重复时单元格涂*,最后提示全部单元格地址。
热心网友 时间:2023-11-02 01:01
Sub 标示重复()
For i = 5 To [c65536].End(3).Row
If Application.CountIf(Range("c:c"), Cells(i, 3)) > 1 Then Cells(i, 3).Interior.ColorIndex = 3
Next
End Sub
热心网友 时间:2023-11-02 01:00
Sub a()
Dim i As Long, iRow As Long
Dim strColorCell As String
iRow = Range("C60000").End(xlUp).Row
For i = 3 To iRow
If WorksheetFunction.CountIf(Range("C:C"), Range("C" & i)) > 1 Then
Range("C" & i).Interior.Color = RGB(255, 255, 0)
strColorCell = Range("C" & i).Address & Chr(10) & strColorCell
End If
Next
MsgBox strColorCell
End Sub
Alt+F11打开编辑窗口,插入模块,复制粘贴代码,F5运行。
代码说明:对C列进行检查,存在重复时单元格涂*,最后提示全部单元格地址。
热心网友 时间:2023-11-02 01:01
Sub 标示重复()
For i = 5 To [c65536].End(3).Row
If Application.CountIf(Range("c:c"), Cells(i, 3)) > 1 Then Cells(i, 3).Interior.ColorIndex = 3
Next
End Sub
热心网友 时间:2023-11-02 01:00
Sub a()
Dim i As Long, iRow As Long
Dim strColorCell As String
iRow = Range("C60000").End(xlUp).Row
For i = 3 To iRow
If WorksheetFunction.CountIf(Range("C:C"), Range("C" & i)) > 1 Then
Range("C" & i).Interior.Color = RGB(255, 255, 0)
strColorCell = Range("C" & i).Address & Chr(10) & strColorCell
End If
Next
MsgBox strColorCell
End Sub
Alt+F11打开编辑窗口,插入模块,复制粘贴代码,F5运行。
代码说明:对C列进行检查,存在重复时单元格涂*,最后提示全部单元格地址。
热心网友 时间:2023-11-02 01:01
Sub 标示重复()
For i = 5 To [c65536].End(3).Row
If Application.CountIf(Range("c:c"), Cells(i, 3)) > 1 Then Cells(i, 3).Interior.ColorIndex = 3
Next
End Sub
热心网友 时间:2023-11-02 01:01
Sub a()
Dim i As Long, iRow As Long
Dim strColorCell As String
iRow = Range("C60000").End(xlUp).Row
For i = 3 To iRow
If WorksheetFunction.CountIf(Range("C:C"), Range("C" & i)) > 1 Then
Range("C" & i).Interior.Color = RGB(255, 255, 0)
strColorCell = Range("C" & i).Address & Chr(10) & strColorCell
End If
Next
MsgBox strColorCell
End Sub
Alt+F11打开编辑窗口,插入模块,复制粘贴代码,F5运行。
代码说明:对C列进行检查,存在重复时单元格涂*,最后提示全部单元格地址。
热心网友 时间:2023-11-02 01:01
Sub 标示重复()
For i = 5 To [c65536].End(3).Row
If Application.CountIf(Range("c:c"), Cells(i, 3)) > 1 Then Cells(i, 3).Interior.ColorIndex = 3
Next
End Sub