|
参与一下。。。
- Sub ykcbf() '//2024.5.27
- Application.ScreenUpdating = False
- nf = Sheets("指定时间段").[i1].Value
- yf = Sheets("指定时间段").[i2].Value
- Select Case yf
- Case Is <= 3
- nf = nf - 1: jd = 4
- Case Is <= 6
- jd = 1
- Case Is <= 9
- jd = 2
- Case Is <= 12
- jd = 3
- End Select
- With Sheets("资料源")
- r = .Cells(Rows.Count, 1).End(3).Row
- arr = .[a1].Resize(r, 11)
- End With
- ReDim brr(1 To UBound(arr), 1 To 3)
- For i = 3 To UBound(arr)
- If arr(i, 1) = nf Then
- If arr(i, 2) >= 1 + (jd - 1) * 3 And arr(i, 2) <= 3 + (jd - 1) * 3 Then
- m = m + 1
- brr(m, 1) = arr(i, 11)
- brr(m, 2) = arr(i, 7)
- brr(m, 3) = arr(i, 8)
- End If
- End If
- Next
- With Sheets("季度表")
- .[u:w] = ""
- .[u5].Resize(m, 3) = brr
- .[u5].Resize(m, 3).Borders.LineStyle = 1
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|