hide a row

cgriff

Board Regular
Joined
Aug 26, 2002
Messages
201
can I hide a row base on a condition of a cell in another row

I dont want to make the row height zero
any ideas

Thanks in advance
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hiding a row is accomplished by setting its Height to 0. have you considered using an Advanced AutoFilter perhaps inconjunction with a Custom View?
 
Upvote 0
Mark is correct, but you can accomplish this with code. Place this in the Sheet module

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$3" Then
If Target.Text = "hide" Then Range("$A$5").EntireRow.Hidden = True
If Target.Text<> "hide" Then Range("$A$5").EntireRow.Hidden = False
End If
End Sub

This will hide row 5 whenever "hide" is entered in B3. Adjust as needed

Edit: you maight also want to look at this thread
http://216.92.17.166/board/viewtopic.php?topic=24792&forum=2
This message was edited by lenze on 2002-10-10 16:29
 
Upvote 0
Untested but try using

Sheet2.Range("$A$5).EntireRow.Hidden etc

or Sheets("SheetName").Range("$S$5").EntireRow etc

Edit: you may have to Activate the sheet in the code.
This message was edited by lenze on 2002-10-10 17:58
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,730
Members
448,987
Latest member
marion_davis

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