Alright, i was able to put something together. Thought I'd share.
In the part of my code where I hide columns, I added an array to register which columns are actually showing:
Wks.Columns(Col.Column).Hidden = False
OpenArray(N) = "yes"
At the end of my sheet I added a new logic to loop through all open columns and add up the cell values. If the cell value is 0 then I hide the row.
' now hide empty rows
' cycle through rows
Set Rng = Wks.Range("C4:Z100")
' loop through rows
R = 3
For Each Row In Rng.Rows
R = R + 1
E = 0
' loop through active columns
For x = LBound(OpenArray) To UBound(OpenArray)
If OpenArray(x) <> "" Then
' I now have the column letter, so I can check its value
E = E + Wks.Range("A1:Z100").Cells.Item(R, x)
End If
Next x
If E = 0 Then
' hide this row
Wks.Rows(R).Hidden = True
Else
'show this row
Wks.Rows(R).Hidden = False
End If
Next Row
Hopefully this will be of use to somebody else, too.
Bookmarks