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

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

kskinne

Well-known Member
Joined
Feb 17, 2002
Messages
1,267
Office Version
  1. 365
Platform
  1. Windows
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
 

kskinne

Well-known Member
Joined
Feb 17, 2002
Messages
1,267
Office Version
  1. 365
Platform
  1. Windows
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
 

Forum statistics

Threads
1,144,281
Messages
5,723,471
Members
422,499
Latest member
think say

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
Top