|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub gj23w98()
- Set wb = Workbooks.Open(ThisWorkbook.Path & "\总表.xlsm")
- Set wk = ThisWorkbook
- With wb.Sheets("总表")
- r1 = .[c2]: r2 = .[h2].Value
- If r2 <= r1 Then arr = .Range("e5:j" & r1)
- End With
- ReDim brr(1 To UBound(arr), 1 To 5)
- With wk.Sheets("组三")
- xm = .[i1]
- For i = 1 To UBound(arr)
- If arr(i, 6) = xm Then
- k = k + 1
- For j = 1 To 5
- brr(k, j) = arr(i, j)
- Next
- End If
- Next
- If k Then
- .[e4].CurrentRegion.Offset(1).ClearContents
- .[e5].Resize(k, 5) = brr
- End If
- End With
- End Sub
复制代码 |
评分
-
2
查看全部评分
-
|