Hello,

I added a code last year to hide certain rows if there was no data in them. In one section, the code had to be altered a little because if there wasn't information in any of a range of columns then hide the row. I am trying to make changes to the spreadsheet and when I do, the code no longer works. Can someone help me please, I had this code entered in several workbooks that I have to edit now. the following is the code causing a runtime error: the error that is highlighted will always be the two lines following the "i = 45-70"

Sub Expense_Hide()
Dim RowCnt As Long
Dim Ws As Worksheet
Dim i, LastRow

Application.ScreenUpdating = False
For Each Ws In Worksheets
Ws.Rows.Hidden = False: Ws.Activate
For i = 45 To 71
If Cells(i, "A").EntireRow.Hidden = True Then
Cells.EntireRow.Hidden = False
Target.Offset(1).Select
Exit Sub
End If
Next

For i = 45 To 70
If Application.Sum(Range("A" & i & ":" & "I" & i)) = 0 _
And Application.CountA(Range("A" & i & ":" & "I" & i)) = 0 Then
Cells(i, "A").EntireRow.Hidden = True
Else
Cells(i, "A").EntireRow.Hidden = False
End If
Next
Next Ws

For Each Ws In Worksheets
'Exclude specific sheets
If Ws.Name <> "ACTUAL VARIANCES" And Ws.Name <> "% VARIANCES" And Ws.Name <> "TOTALS" And Ws.Name <> "Chart Total Difference" And Ws.Name <> "OVERTIME" Then
With Ws
For RowCnt = 6 To 41
If .Cells(RowCnt, 3).Value = 0 Then
.Rows(RowCnt).Hidden = True
End If
Next RowCnt

For RowCnt = 78 To 111
If .Cells(RowCnt, 3).Value = 0 Then
.Rows(RowCnt).Hidden = True
End If
Next RowCnt
End With
End If
Next Ws

Application.ScreenUpdating = True

End Sub