SOLVED!HIDE ROWS IF CERTAIN CELLS BLANK

ROBINSYN

Board Regular
Joined
Aug 19, 2002
Messages
188
IS THERE A WAY I CAN ASSIGN A MACRO TO HIDE CERTAIN ROWS IF FOR EXAMPLE E2,E3,E4'E5 ARE =0. AND ANOTHER MACRO TO ONHIDE ALL ROWS.


ANY HELP APPRECIATED
This message was edited by ROBINSYN on 2002-10-27 18:13
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
try these out:
Code:
Sub Hide_Rows()
Application.ScreenUpdating = False
If [E2].Value = 0 Then Rows("2").EntireRow.Hidden = True
If [E3].Value = 0 Then Rows("3").EntireRow.Hidden = True
If [E4].Value = 0 Then Rows("4").EntireRow.Hidden = True
If [E5].Value = 0 Then Rows("5").EntireRow.Hidden = True
Application.ScreenUpdating = False
End Sub

Code:
Sub Unhide_Rows
Rows("2:5").EntireRow.Hidden = False
End Sub

HTH
kevin
 
Upvote 0
good point Juan Pablo

Robin, you could also make this into a macro:

Sub Hide_Me()
[E2:E5].AutoFilter Field:=1, Criteria1:="<>0"
End Sub

and assign it to a command button. the macro to unfilter it would be:

Sub Unhide_Me()
[E2:E5].AutoFilter Field:=1
End Sub

kevin
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,981
Members
449,058
Latest member
oculus

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