View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Paul Robinson Paul Robinson is offline
external usenet poster
 
Posts: 208
Default Totals rows shouldn't become invisible when filtering

Hi
You will need to be more precise about the range you are filtering, so
that the total rows are excluded. Then you won't need the
worksheet_Calculate code.
What is your code that does the filter?
regards
Paul

On Oct 7, 12:18*am, "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?