View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default Hide and printout area conditions

I'd like to propose another approach that you may or may not like...

Off to the right side of your data you could have a column of formulas that
determine whether the row is to be hidden. Let's say that column Z is out
of sight, so in cell Z5 you enter this formula:

=IF(SUM(D5,F5,G5)=0,TRUE,1)

You can include all the cells you want to check on row 5. Then copy this
formula from Z5 all the way to Z206. If the formula returns True the row is
be hidden, if it returns 1 it is not.

Then the macro can be as simple as this:

Application.ScreenUpdating = False
On Error Resume Next
With Range("Z5:Z206")
.Rows.Hidden = False ''not needed if all rows are visible to start
with
.SpecialCells(xlCellTypeFormulas, xlLogical).Rows.Hidden = True
End With

If you want you can hide column Z and no one will know it's there.

--
Jim Rech
Excel MVP
"Jonsson " wrote in message
...
Hi, Jared! And all you out there

The code you, Jared, gave me works nice!
Thanks!
No, is it possible to do the same procedure but let the macro check
several different columns, lets say 7 of them?

I have tried to write for instance"E", "G", "T" columns, instead of
just "E", but that dont work, of course.

Any idea´s?

//Thomas


---
Message posted from http://www.ExcelForum.com/