|
参与一下。。。- Sub ykcbf() '//2024.3.12
- Set d = CreateObject("Scripting.Dictionary")
- Dim arr, brr(1 To 10000, 1 To 7)
- Set Sh = ThisWorkbook.Sheets("合并")
- For Each sht In Sheets
- If sht.Name <> Sh.Name Then
- arr = sht.[a1].CurrentRegion
- For i = 2 To UBound(arr)
- s = arr(i, 1)
- If Not d.exists(s) Then
- m = m + 1
- d(s) = m
- For j = 1 To 7
- brr(m, j) = arr(i, j)
- Next
- Else
- r = d(s)
- brr(r, 2) = brr(r, 2) + arr(i, 2)
- For j = 3 To 7
- Sum = 0: st = ""
- For x = 1 To 5
- st1 = Val(Mid(brr(r, j), x, 1))
- st2 = Val(Mid(arr(i, j), x, 1))
- Sum = st1 + st2
- If Sum = 2 Then Sum = 1
- st = st & Sum
- Next
- brr(r, j) = st
- Next
- End If
- Next
- End If
- Next
- With Sh
- .[a2:g10000] = Empty
- .Columns("C:G").NumberFormatLocal = "@"
- .[a1].Resize(1, 7).Interior.Color = 49407
- .[a2].Resize(m, 7) = brr
- .[a1].Resize(m + 1, 7).Borders.LineStyle = 1
- End With
- Set d = Nothing
- MsgBox "OK!"
- End Sub
复制代码
|
|