Hello,
For many years I have been using a macro that I got from someone here to Unhide/Hide zero rows in Sage Intelligence workbooks and it has always worked great. I have recently had an issue with it acting unexpectedly for one client and wanted to see if anyone has run into similar issues with macros. It seems to unexpectedly not hide rows that it should be hiding and the client is also telling me that it is hiding rows it shouldn't be. I can't replicate this on the clients system consistently. It really seems to do something different each time. Has anyone run into this before? Any thoughts or suggestions on why?
Sub UnhideRows()
Dim sh As Worksheet
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
For Each sh In ThisWorkbook.Worksheets
sh.Cells.EntireRow.Hidden = False
Next sh
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
Sub HideZeroRows()
Dim sh As Worksheet
Dim i As Long
On Error Resume Next
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
For Each sh In ThisWorkbook.Worksheets
For i = 9 To 327
If Not IsEmpty(Range("T" & i)) Then
If IsNumeric(Range("T" & i)) Then
sh.Rows(i).Hidden = Application.Sum(sh.Range("T" & i).Resize(, 36)) = 0
End If
End If
Next i
Next sh
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
------------------------------
Jesse Braun
Vrakas/Blum Computer Consulting, Inc.
------------------------------