Hiding Rows Automatically

gbwcf

New Member
Joined
Oct 16, 2002
Messages
6
I'm trying to set up a worksheet so that
if a specific cell = "", then
the entire row is hidden.

Any ideas?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
You can also convert this to an "Event" code so it will run automaticall when any re-calculation or new selection is made. The problem with this is if yoy change the code below to work with "Blanks" ("") rather than "0." Then you will hide all blank rows and your sheet will be difficult to manage, so the manual code below is better, just change the "0" to "". JSW

Sub MyHide()
'This "Hides" any Row in Column(A) that =0, rows: 1 through 10.
'By J.S. Was, 6-12-2001.
Dim i
For i = 1 To 10
With Intersect(Columns(1), ActiveSheet.UsedRange)
Rows(i).Select
If .Rows(i).Value = 0 Then
Selection.EntireRow.Hidden = True
End If
End With
Next
End Sub
 
Upvote 0
I recently posted the same question and got received some useful replies ... search on my User name (JHSam) for the relevant post and reply.

JS
 
Upvote 0

Forum statistics

Threads
1,222,018
Messages
6,163,426
Members
451,835
Latest member
kristianb63

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