|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
改一下,速度会快一些,实测通过- Sub 行列隐藏()
- Application.ScreenUpdating = False
- Set Rng = Nothing
- With ActiveSheet
- .Unprotect "zjx"
- r = .Cells(Rows.Count, 4).End(3).Row
- .Rows("1:" & r).Hidden = False
- arr = .UsedRange
- For i = 70 To 142
- If Len(arr(i, 4) & arr(i, 9)) = 0 Then
- If Rng Is Nothing Then
- Set Rng = .Cells(i, 4)
- Else
- Set Rng = Union(Rng, .Cells(i, 4))
- End If
- End If
- Next i
- If Not Rng Is Nothing Then Rng.EntireRow.Hidden = True
- .Protect "zjx"
- End With
- Application.ScreenUpdating = True
- End Sub
复制代码
|
|