PDA

View Full Version : Looking for a faster way to autohide rows



IRish3538
05-08-2012, 12:58 PM
Hey all!

I have a worksheet that has several tables that get automatically populated.. at the end of the sub, i hide out all rows that dont't get used by using "for each cell in range". it works fine, but when it scans thru 100+ rows, its get kind of slow (even with screenupdating off).. any idea how i can do this better?

For Each Cell In Sheet8.Range("b4:b100")
Select Case Cell.Value
Case Is = 0
Cell.EntireRow.Hidden = True
End Select
Next

CatDaddy
05-08-2012, 01:23 PM
could you just use a filter on your results when your macro is finished?

IRish3538
05-08-2012, 01:26 PM
it's actually 10 tables the go one after another (vertically). i leave 25 rows for each, then hide out everything without a value to "condense" the tables.

geekgirlau
05-08-2012, 08:56 PM
As CatDaddy suggests, AutoFilter is the simplest method to do this. Can I ask why you have 10 separate tables running vertically?