|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
参与一下。。。
- Sub ykcbf() '//2023.12.28
- Dim arr, d
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("Sheet2")
- r = .Cells(.Rows.Count, "a").End(xlUp).Row
- arr = .[a1].Resize(r, 1)
- End With
- For i = 2 To UBound(arr)
- s = arr(i, 1)
- d(s) = ""
- Next
- With Sheets("Sheet1")
- .UsedRange.Interior.ColorIndex = 0
- r = .Cells(.Rows.Count, "a").End(xlUp).Row
- arr = .[a1].Resize(r, 1)
- For i = 2 To UBound(arr)
- s = arr(i, 1)
- If d.Exists(s) Then
- .Cells(i, 1).Interior.ColorIndex = 6
- .Cells(i, 6) = "已登记"
- Else
- .Cells(i, 6) = ""
- End If
- Next
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|