|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
代码供参考,代码以附件为准。- Sub ykcbf() '//2024.1.31
- Dim arr, brr, d, r, s, i, bm, dd, st
- Set d = CreateObject("Scripting.Dictionary")
- With Sheets("总档")
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .Range("a1:l" & r)
- End With
- For i = 2 To UBound(arr)
- s = arr(i, 2) & "|" & arr(i, 1)
- st = arr(i, 9) & "(" & arr(i, 6) & ")"
- If Not d.exists(s) Then
- d(s) = st
- Else
- d(s) = IIf(InStr(d(s), st), d(s), d(s) & st)
- End If
- Next
- With Sheets("条码打印")
- bm = .[t2]
- dd = .[t6]
- s = bm & "|" & dd
- If d.exists(s) Then
- .[t7] = d(s)
- End If
- End With
- Set d = Nothing
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|