|
参与一下。。。
- Sub ykcbf() '//2024.3.24
- Dim arr, d
- Application.ScreenUpdating = False
- Set d = CreateObject("Scripting.Dictionary")
- Set Sh = ThisWorkbook.Sheets("汇总")
- zrr = Sh.UsedRange
- For j = 2 To UBound(zrr, 2)
- s = zrr(2, j)
- d(s) = j
- Next
- arr = Sheets("数据库").UsedRange
- ReDim brr(1 To UBound(arr), 1 To UBound(zrr, 2))
- yf = Month(Date)
- For i = 7 To UBound(arr)
- If Val(arr(i, 1)) Then
- If Month(arr(i, 12)) = yf Then
- m = m + 1
- brr(m, 1) = m
- For j = 2 To UBound(arr, 2)
- s = arr(6, j)
- If d.exists(s) Then
- brr(m, d(s)) = arr(i, j)
- End If
- Next
- End If
- End If
- Next
- With Sh
- .UsedRange.Offset(2) = ""
- .[a3].Resize(m, UBound(zrr, 2)) = brr
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
2
查看全部评分
-
|