Use a slightly different formula and it becomes a lot easier:
=IF($A$1=1,TRUE,"")
So say these formulas are in the range C1:C20. This macro will first show
all rows in that range and then hide those whose formula returns TRUE.
Sub HideRows()
Application.ScreenUpdating = False
With Range("C1:C20")
.Rows.Hidden = False
.SpecialCells(xlCellTypeFormulas, xlLogical).Rows.Hidden = True
End With
End Sub
--
Jim
"Clueless" wrote in message
...
| Hello all. I have a spreadsheet that is over 500 rows long. As it is I
have
| no use for all of the rows at the same time and have to keep hiding and
| showing them as need arises. Is there a macro to hide chunks of it based
on
| the value of one cell of the row? In other words, en each row I will have
a
| formula like =if(a1=0,"HIDE","") and this value will tell the macro wether
to
| hide the row or not. I tried case.select but it takes a LONG time and I
would
| have to write a piece of code for every line. FYI, the rows that need
hiding
| will be in sequence, in other words, from 100 to 500, or from 80 to 500,
| depends on where the last text was entered. Thanks in advance.
|