|
本帖最后由 ykcbf1100 于 2024-11-13 11:21 编辑
新写一个吧。- Sub ykcbf() '//2024.11.13
- Application.ScreenUpdating = False
- With Sheets("入库明细")
- r = .Cells(Rows.Count, 3).End(3).Row
- arr = .[c1].Resize(r, 15)
- End With
- ReDim brr(1 To r, 1 To 15)
- With Sheets("记录表1")
- st = .[a1].Value
- rq1 = .[b1].Value
- rq2 = .[c1].Value
- .UsedRange.Offset(2).ClearContents
- For i = 6 To UBound(arr)
- If arr(i, 12) = st Then
- If arr(i, 2) >= rq1 And arr(i, 2) <= rq2 Then
- m = m + 1
- For j = 1 To UBound(arr, 2)
- brr(m, j) = arr(i, j)
- Next
- brr(m, 4) = Split(brr(m, 4), Chr(10))(0)
- If brr(m, 5) <> Empty Then brr(m, 5) = Split(brr(m, 5), Chr(10))(0)
- End If
- End If
- Next
- .[a3].Resize(m, 15) = brr
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|