Require help with VBA code for hiding rows based on cells in range of columns being 0
I'm found this code to use but when I use it, it hides all the rows. I need it to hide row if all cells in columns H through L show a 0 value. Can someone please help me with this.
Sub Hide_rows()
Dim LastRow As Long
Dim Rng As Range
LastRow = Range("A125").End(xlUp).Row '
Set Rng = Range("H3:L125")
Application.ScreenUpdating = False
For Each cell In Rng
If cell.Value = "0" Then
cell.EntireRow.Hidden = True
End If
Next cell
Application.ScreenUpdating = True
End Sub
I'm found this code to use but when I use it, it hides all the rows. I need it to hide row if all cells in columns H through L show a 0 value. Can someone please help me with this.
Sub Hide_rows()
Dim LastRow As Long
Dim Rng As Range
LastRow = Range("A125").End(xlUp).Row '
Set Rng = Range("H3:L125")
Application.ScreenUpdating = False
For Each cell In Rng
If cell.Value = "0" Then
cell.EntireRow.Hidden = True
End If
Next cell
Application.ScreenUpdating = True
End Sub