|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 ykcbf1100 于 2024-7-22 09:43 编辑
复制指定字段筛选值- Sub ykcbf() '//2024.7.22 复制筛选值
- Application.ScreenUpdating = False
- Application.DisplayAlerts = False
- b = [{2,3,4,5,17,18,19}]
- ReDim brr(1 To 10000, 1 To 100)
- With Sheets("复制")
- r = .Cells(Rows.Count, 3).End(xlUp).Row
- Set Rng = .[a4].Resize(r-3, 19)
- For Each Row In Rng.Rows
- If Row.Hidden = False Then
- m = m + 1
- zrr = Row.Value
- For x = 1 To UBound(b)
- brr(m, x) = zrr(1, b(x))
- Next
- End If
- Next
- End With
- With Sheets("结果 ")
- .[f5:l10000].ClearContents
- .[f5].Resize(m, UBound(b)) = brr
- End With
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
|