Filtering data hides row

J

John

When I filter data in Excel 2007 my totals row (at the bottom of the data)
dissappears. I put the following statement in my Worksheet_Change and
Worksheet_SelectionChange event:

Range("TotalsRow").EntireRow.Hidden = False

On large files this slows down my spreadsheet considerably. Is there a
better way to unhide this row when I filter data?
 
J

John

I had thought about putting the totals at the top, and I may be forced to do
so. I prefer they be on the bottom. I'm thinking if I used an IF statement
in my events (If FilterMode, for example), then the statement wouldn't be
evaluated by Excel as many times? I'm still looking for ideas.
 
D

Don Guillett

Filter on one row less than the last row. Notice the -1

lr = Cells(Rows.Count, "b").End(xlUp).Row-1
With Range("a2:i" & lr)
.AutoFilter Field:=1, Criteria1:="whatever"
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top