I'm attempting to look at a user defined range to see which rows sum to zero and then hide those rows. It hides the first row, but doesn't move on to the next rows. Where did I go wrong? Using Excel 2016.
Code:
Dim rng As Range
Dim row As Range
Dim cell As Range
Dim FRow As Integer
Dim LRow As Integer
FRow = InputBox("Enter the first row of the reconciliation.")
LRow = InputBox("Enter the last row of the reconciliation.")
Set rng = Range(Cells(FRow, 4), Cells(LRow, 9))
For Each row In rng.Rows
If WorksheetFunction.Sum(row) = 0 Then
Selection.EntireRow.Hidden = True
Else
End If
Next row