|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
参与一下。。。。
- Sub ykcbf() '//2024.4.5
- Dim arr, d
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("Sheet2")
- r = .Cells(.Rows.Count, "c").End(xlUp).Row
- arr = .[c1].Resize(r, 1)
- End With
- For i = 3 To UBound(arr)
- s = arr(i, 1)
- d(s) = ""
- Next
- Set Rng = Nothing
- With Sheets("Sheet1")
- r = .Cells(.Rows.Count, "c").End(xlUp).Row
- arr = .[c1].Resize(r, 1)
- For i = 3 To UBound(arr)
- s = arr(i, 1)
- If d.Exists(s) Then
- If Rng Is Nothing Then
- Set Rng = .Cells(i, 3)
- Else
- Set Rng = Union(Rng, .Cells(i, 3))
- End If
- End If
- Next
- Rng.Select
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|