|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Private Sub Wo()
arr = Application.Intersect(ActiveSheet.UsedRange, Columns("A:B"))
Set d = CreateObject("scripting.dictionary")
str1 = ""
For j = 1 To UBound(arr)
If Len(arr(j, 1) & ARR(J,2)) > 0 Then
d(arr(j, 1)& "#" & ARR(J,2)) = 1 + d(arr(j, 1)& "#" & ARR(J,2))
If d(arr(j, 1)& "#" & ARR(J,2)) = 2 Then
str1 = str1 & Chr(10) & arr(j, 1) & ARR(J,2)
End If
End If
Next j
If Len(str1) > 0 Then MsgBox Mid(str1, 2) & Chr(10) & "以上数据又重复,请查阅": Cancel = True
End Sub
看看是否能满足需求吧 |
|