ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide Entire Row If Cell = 0 (https://www.excelbanter.com/excel-programming/371705-hide-entire-row-if-cell-%3D-0-a.html)

Sean[_15_]

Hide Entire Row If Cell = 0
 
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

Ron de Bruin

Hide Entire Row If Cell = 0
 
Hi Sean

Why not AutoFilter for 0 ?
Or do you want to hide without a filter

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Sean" wrote in message ...
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




Bob Phillips

Hide Entire Row If Cell = 0
 
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)

"Sean" wrote in message
...
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




Ron de Bruin

Hide Entire Row If Cell = 0
 
More info

Custom..Not contain 0

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


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Ron de Bruin" wrote in message ...
Hi Sean

Why not AutoFilter for 0 ?
Or do you want to hide without a filter

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Sean" wrote in message ...
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






Sean[_15_]

Hide Entire Row If Cell = 0
 
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

"Ron de Bruin" wrote:

Hi Sean

Why not AutoFilter for 0 ?
Or do you want to hide without a filter

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Sean" wrote in message ...
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





Sean[_15_]

Hide Entire Row If Cell = 0
 
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?

"Bob Phillips" wrote:

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)

"Sean" wrote in message
...
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





Ron de Bruin

Hide Entire Row If Cell = 0
 
See Bob's reply for a example

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Sean" wrote in message ...
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

"Ron de Bruin" wrote:

Hi Sean

Why not AutoFilter for 0 ?
Or do you want to hide without a filter

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Sean" wrote in message ...
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







Sean[_15_]

Hide Entire Row If Cell = 0
 
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!!!

"Bob Phillips" wrote:

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)

"Sean" wrote in message
...
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





Gary Keramidas

Hide Entire Row If Cell = 0
 
works for me, sure the sheet isn't protected or something

--


Gary


"Sean" wrote in message
...
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!!!

"Bob Phillips" wrote:

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)

"Sean" wrote in message
...
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








All times are GMT +1. The time now is 04:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com