|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub 汇总()
- hz = Sheets("回执单登记表").UsedRange
- Set dhz = CreateObject("scripting.dictionary")
- For i = 3 To UBound(hz)
- If hz(i, 2) <> "" Then dhz(hz(i, 2)) = ""
- Next i
-
- With Sheets("汇总")
- .Range("A4:H" & Rows.Count).Clear
- brr = .Range("A1:H9999")
- End With
- Dim sh As Worksheet
- n = 3
- For Each sh In Sheets
- If InStr(sh.Name, "月") Then
- arr = sh.UsedRange
- For i = 3 To UBound(arr)
- qz = Left(arr(i, 1), 2)
- If qz = "CF" And arr(i, 10) <> "款到" And arr(i, 12) = "是" Then
- n = n + 1
- brr(n, 1) = arr(i, 1)
- brr(n, 2) = arr(i, 2)
- brr(n, 3) = arr(i, 3)
- brr(n, 4) = arr(i, 10)
- brr(n, 5) = arr(i, 12)
- brr(n, 6) = arr(i, 13)
- brr(n, 7) = arr(i, 14)
- If dhz.exists(arr(i, 1)) Then brr(n, 8) = "是" Else brr(n, 8) = "否"
- End If
- Next i
- End If
- Next sh
-
- Sheets("汇总").Range("A1").Resize(UBound(brr), UBound(brr, 2)) = brr
- Set dhz = Nothing
- End Sub
复制代码 |
|