Hide/Unhide rows automatically??

Goliath

New Member
Joined
Mar 19, 2008
Messages
37
My situation is I would like to hide rows 29:32 if the value in cell H29 is $0.00. If the value in cell H29 is anything other than $0.00, then I would like to have rows 29:32 displayed. Is this possible you think?

Perhaps this is more complicated than it seems. Thanks in advance for your help!
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Is the value in H29 entered manually, or is it a formula?
And does it have to actually be 0, or should Blank be considered 0?
 
Upvote 0
Is the value in H29 entered manually, or is it a formula?
And does it have to actually be 0, or should Blank be considered 0?


The number in H29 begins with $0.00. On another worksheet, the user will enter information and the other worksheet calculates a result. That result is then transferred to cell H29 on the first worksheet.

You see, if the user elects not to enter information on the other worksheet, then I would simply not to display rows Rows 29 - 32.

Do you think it would be easier if cell H29 be blank to accomplish this?
 
Upvote 0
The number in H29 begins with $0.00. On another worksheet, the user will enter information and the other worksheet calculates a result. That result is then transferred to cell H29 on the first worksheet.?

How??

Let's not use this sheet or other sheet...
give sheet names.

On Sheet named xx, I want if H29 = 0 then hide rows....
On Sheet named xx, I want if H29 <> 0 then show rows....

H29 on Sheet xx get's it's value from .....??
 
Upvote 0
How??

Let's not use this sheet or other sheet...
give sheet names.

On Sheet named xx, I want if H29 = 0 then hide rows....
On Sheet named xx, I want if H29 <> 0 then show rows....

H29 on Sheet xx get's it's value from .....??

Absolutely...

On Sheet named "Summary", I would like rows 29:34 hidden if the value in cell H29 on the Summary worksheet is $0.00.

On the summary worksheet cell H29 has any value other than $0.00, then I would like to rows 29:34 be displayed.

Cell H29 gets its value from cell D8 on worksheet CHANGE. The formula in cell H29 is simply =CHANGE!D8.
 
Upvote 0
OK, great

On the summary sheet.
Right click the sheet's tab, view code
Paste the following

Code:
Private Sub Worksheet_Calculate()
Range("29:32").EntireRow.Hidden = Range("H29") = 0
End Sub

Hope that helps.
 
Upvote 0
Jonmo1...THANK YOU! That worked perfectly.

I'm not going to say I completely understand it but nevertheless, it works.

Thanks again very much.
 
Upvote 0
OK, great

On the summary sheet.
Right click the sheet's tab, view code
Paste the following

Code:
Private Sub Worksheet_Calculate()
Range("29:32").EntireRow.Hidden = Range("H29") = 0
End Sub
Hope that helps.


Jonmo- Ran into a small problem... Everything was working fine until I protected and hid some areas of the worksheet. All of a sudden, I started getting Visual Basic error...specifically "Run-time error '1004': Unable to set the hidden property of the range class".

I am not sure what this means. The areas hidden are not rows 29:32. Do you have any idea what my issue is? Thank you so much for your help here.
 
Upvote 0
The problem is the protection of the sheet...

Unprotect it at the beginning of the code..

Sheets("Sheetname").Unprotect "Passwordgoeshere"

Then run the rest of the code

Then reprotect at the end

Sheets("Sheetname").Protect "Passwordgoeshere"
 
Upvote 0

Forum statistics

Threads
1,224,508
Messages
6,179,189
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top