Good afternoon-
I'm running what I consider to be a fairly simple code. It works but it takes roughly 30 seconds to run which is driving me a little bonkers. I have ala carte pricing from rows 18 to 463. What this codes is saying is if my sales rep enters a value in column H to not hide that row. If the cell is left blank then hide that row. Looking for insight on how to streamline this code so it speeds up the macro. Any insight is appreciated. Thanks
Sub HideAllRows()
'Hides everything without a quantity in column H. Used for all three sales teams as well as Bid Desk when hiding everything if we've added something custom
Unprotect Password:="PW"
Application.ScreenUpdating = True
For Each cell In Range("H18:H463")
cell.EntireRow.Hidden = cell.Value = 0
Next cell
ActiveSheet.Protect Password:="PW", AllowFormattingCells:=True
End Sub
I'm running what I consider to be a fairly simple code. It works but it takes roughly 30 seconds to run which is driving me a little bonkers. I have ala carte pricing from rows 18 to 463. What this codes is saying is if my sales rep enters a value in column H to not hide that row. If the cell is left blank then hide that row. Looking for insight on how to streamline this code so it speeds up the macro. Any insight is appreciated. Thanks
Sub HideAllRows()
'Hides everything without a quantity in column H. Used for all three sales teams as well as Bid Desk when hiding everything if we've added something custom
Unprotect Password:="PW"
Application.ScreenUpdating = True
For Each cell In Range("H18:H463")
cell.EntireRow.Hidden = cell.Value = 0
Next cell
ActiveSheet.Protect Password:="PW", AllowFormattingCells:=True
End Sub