View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John[_146_] John[_146_] is offline
external usenet poster
 
Posts: 5
Default Totals rows shouldn't become invisible when filtering

I have 2 rows of totals at the bottom of my database (separated from the DB
by an empty row). When filtering with AutoFilter, the totals rows will
sometimes become hidden. I added the following procedure in my worksheet
calculate event in an attemt to remedy this problem:

Private Sub Worksheet_Calculate()
'Prevent Totals Row from being hidden when filtering
On Error Resume Next
If wshDatabase.Range("TotalsRows").EntireRow.Hidden = True Then
wshDatabase.Range("TotalsRows").EntireRow.Hidden = False
Exit Sub
On Error GoTo 0
End If
End Sub

The problem is, this sub causes Excel to crash. Can someome recommend a
better sub to keep the totals rows unhidden when filtering?