|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 张星星55 于 2021-5-20 14:54 编辑
Sub 筛选()
Dim sh As Worksheet, rng As Range, n As Integer
Dim arr()
For Each sh In Worksheets
If sh.Name <> "查询" And sh.Name <> "产量" Then
For Each rng In Intersect(sh.UsedRange, sh.[c:c])
If rng.Value Like "*梁*" Then
n = n + 1
ReDim Preserve arr(1 To n)
arr(n) = rng.Offset(0, -2).Resize(1, 11)
End If
Next
End If
Next sh
Sheet17.Range("a2").Resize(n, 11) = Application.Transpose(Application.Transpose(arr))
End Sub
|
|