DarkJester89
Board Regular
- Joined
- Nov 5, 2017
- Messages
- 109
- Office Version
- 2016
- Platform
- Windows
Hello, I have the following code but I dont know if its the formatting of the code of there is an easy way to do this code.
It's supposed to hide rows in the range if their value is 0 or "", not unhide it. The code as is works, it just ramps up and takes about 15-20 seconds to calculate by itself.
Is there an more efficient way for this to operate? I have it a macro on a command button, not a worksheet activate or calculate at all times type code. Thank you in advance.
It's supposed to hide rows in the range if their value is 0 or "", not unhide it. The code as is works, it just ramps up and takes about 15-20 seconds to calculate by itself.
Is there an more efficient way for this to operate? I have it a macro on a command button, not a worksheet activate or calculate at all times type code. Thank you in advance.
VBA Code:
Sub hiderows()
Dim c As Range
Application.ScreenUpdating = False
For Each c In Range("A3:A73")
If c.Value = 0 Or c.Value = "" Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next c
Application.ScreenUpdating = True
End Sub