|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub 矩形圆角2_Click()
Set d = CreateObject("scripting.dictionary")
Application.ScreenUpdating = False
For Each sh In Sheets
If sh.Name <> "总表" Then
arr = sh.UsedRange
For j = 3 To UBound(arr)
If Not d.exists(arr(j, 2)) Then
Set d(arr(j, 2)) = CreateObject("scripting.dictionary")
End If
d(arr(j, 2))(sh.Name) = d(arr(j, 2))(sh.Name) + 1
Next j
End If
Next sh
arr = Sheets("总表").UsedRange
For j = 3 To UBound(arr)
If d(arr(j, 2)).Count > 1 Then
str1 = ""
For Each k In d(arr(j, 2)).keys
str1 = str1 & "/" & k & "*" & d(arr(j, 2))(k)
Next k
arr(j, 4) = Mid(str1, 2)
Else
arr(j, 4) = d(arr(j, 2)).keys()(0)
End If
Next j
Sheets("总表").UsedRange = arr
Application.ScreenUpdating = True
End Sub
|
|