|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub gj23w98()
- Dim crr(1 To 999, 1 To 8)
- Application.ScreenUpdating = False
- arr = Sheet1.[a1].CurrentRegion
- brr = Range("a1:c3")
- For i = 3 To UBound(arr)
- If Year(arr(i, 2)) & Month(arr(i, 2)) & arr(i, 3) = brr(2, 1) & brr(2, 3) & brr(3, 2) Then
- m = m + 1
- crr(m, 1) = arr(i, 1)
- crr(m, 2) = arr(i, 2)
- For j = 3 To 8
- crr(m, j) = arr(i, j + 1)
- Next
- End If
- Next
- If m Then
- Range("a5:h" & Rows.Count).ClearContents
- [a5].Resize(m, 8) = crr
- Else
- MsgBox "没有符合条件的数据哦,请查证!"
- End If
- Application.ScreenUpdating = True
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|