Hide Entire Row If Cell = 0

G

Guest

I have a large area that contains a lot of zero's, I want to be able to put a
command button out there to HIDE / UNHIDE these rows.

The macro should search column AL35:AL609 this is very specific. If it
finds a 0 in the column it should hide the entire row.

I can add two buttons if needed one to hide and one to show, if needed.

Thanks,

Sean
 
B

Bob Phillips

For Each cell In Range( "AL35:AL609")
cell.Entirerow.Hidden = cell.Value = 0
Next cell

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
R

Ron de Bruin

More info

Custom..Not contain 0

Record a macro when you do it and look at the code
 
G

Guest

Hide witout a filter, there is data above the specified starting row of AL35
that I dont want included. Thats why I would like a macro to do this, for
the specified data range of AL35 through AL609

Thanks,

Sean
 
G

Guest

I hate to be a pain, but is there a way if I put a check box out there, if it
is checked it does the following code, and if unchecked it makes the row
visible?
 
G

Guest

When I typed in the code I got an error when I executed it. I double checked
it and it says

RUN-TIME ERROR '1004'!

UNABLE TO SET THE HIDDEN PROPERTY OF THE RANGE CLASS

Any Help!!!
 

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