View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Excel MVP Don Guillett Excel MVP is offline
external usenet poster
 
Posts: 168
Default Totals rows shouldn't become invisible when filtering

On Oct 6, 6:18*pm, "John" wrote:
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?


Why not just have your autofilter exclude the last two rows