Hiding Rows if row contains zero value in cell : 'x' ??

  • Thread starter Thread starter Laurie
  • Start date Start date
L

Laurie

Hi all, this one might be an 'Excel for dummies' question.

But I would like to know if there is a command or Macro
that can be written to hide a row in a worksheet if for
eg I want to:

hide row 'D' if the value in 'D22' is 0.00 etc

Whether its hidden on the printed output or on the
worksheet itself I dont mind.. but I just can't figure out
(using Excel's help index) how to do it...

Can any of you excel wizards out there help me ?

Cheers from downunder...

Laurie
 
'D' is 'column', isn't 'row'
If there is 1000 rows,'zero' in the 4th column(Column D), the code:

sub macro1()
r=4
k=1000
for i=1 to k
if cells(i,r).value=0 then
rows(i).heigh=0
end if
end sub
 
If your worksheet is set up as a table, with column headings, you could
use an AutoFilter to hide the rows:

Select a cell in the table
Choose Data>Filter>AutoFilter
From the dropdown list in the column D heading, select 'Custom'
From the first dropdown list, choose 'does not equal'
In the text box, type a zero
Click OK
 
Back
Top