Hello,

I have been trying to find a solution to the following problem since yesterday. So I finally came up with this code:

Sub Worksheet_Hide()
Dim lastRow As Long, myRange As Range
Application.Calculation = xlCalculationManual
lastRow = Cells(Rows.Count, 2).End(xlUp).Row
Rows.Hidden = False
For Each myRange In Range("g11:r62")
If myRange.Value = 0 Then myRange.EntireRow.Hidden = True
Next myRange
End Sub

Here is my problem. The range of the table that I need to check is g11:r62. If any cell in that range is populated then I don't want the row collapsed, but if every cell in the row is zero, then I would like it to be collapsed. As you can see now from looking at the code, it collapses everything. Every cell is hidden if any cell is empty.